diff --git a/examples/build_file_generation/requirements_lock.txt b/examples/build_file_generation/requirements_lock.txt index 7573a6f591..b66c41fef9 100644 --- a/examples/build_file_generation/requirements_lock.txt +++ b/examples/build_file_generation/requirements_lock.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.9 # To update, run: # # pip-compile --generate-hashes --output-file=requirements_lock.txt requirements.txt diff --git a/examples/pip_install/requirements.txt b/examples/pip_install/requirements.txt index c0c1de5ced..43bfad4e2b 100644 --- a/examples/pip_install/requirements.txt +++ b/examples/pip_install/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.9 # To update, run: # # bazel run //:requirements.update diff --git a/examples/pip_parse/requirements_lock.txt b/examples/pip_parse/requirements_lock.txt index 5286de55ac..f270699e7b 100644 --- a/examples/pip_parse/requirements_lock.txt +++ b/examples/pip_parse/requirements_lock.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.9 # To update, run: # # bazel run //:requirements.update diff --git a/examples/pip_parse_vendored/requirements.txt b/examples/pip_parse_vendored/requirements.txt index 62f65ea5d5..81b56154c2 100644 --- a/examples/pip_parse_vendored/requirements.txt +++ b/examples/pip_parse_vendored/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.9 # To update, run: # # bazel run //:requirements.update diff --git a/examples/pip_repository_annotations/requirements.txt b/examples/pip_repository_annotations/requirements.txt index db762cbbf4..e1c53c27e3 100644 --- a/examples/pip_repository_annotations/requirements.txt +++ b/examples/pip_repository_annotations/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.9 # To update, run: # # bazel run //:requirements.update diff --git a/python/BUILD b/python/BUILD index 74c2c1c087..05cc9d1c42 100644 --- a/python/BUILD +++ b/python/BUILD @@ -46,6 +46,8 @@ filegroup( "defs.bzl", "packaging.bzl", "pip.bzl", + "repositories.bzl", + "versions.bzl", "//python/pip_install:bzl", "//python/private:bzl", ], diff --git a/python/pip_install/extract_wheels/lib/wheel.py b/python/pip_install/extract_wheels/lib/wheel.py index afd4329310..ac6d6779ab 100644 --- a/python/pip_install/extract_wheels/lib/wheel.py +++ b/python/pip_install/extract_wheels/lib/wheel.py @@ -1,6 +1,6 @@ """Utility class to inspect an extracted wheel directory""" import email -from typing import Dict, Optional, Set +from typing import Dict, Optional, Set, Tuple import installer import pkg_resources @@ -33,7 +33,7 @@ def version(self) -> str: # TODO Also available as installer.sources.WheelSource.version return str(self.metadata["Version"]) - def entry_points(self) -> Dict[str, tuple[str, str]]: + def entry_points(self) -> Dict[str, Tuple[str, str]]: """Returns the entrypoints defined in the current wheel See https://packaging.python.org/specifications/entry-points/ for more info diff --git a/python/pip_install/repositories.bzl b/python/pip_install/repositories.bzl index a57ff9deaa..a5106b4932 100644 --- a/python/pip_install/repositories.bzl +++ b/python/pip_install/repositories.bzl @@ -22,6 +22,11 @@ _RULE_DEPS = [ "https://files.pythonhosted.org/packages/1b/21/3e6ebd12d8dccc55bcb7338db462c75ac86dbd0ac7439ac114616b21667b/installer-0.5.1-py3-none-any.whl", "1d6c8d916ed82771945b9c813699e6f57424ded970c9d8bf16bbc23e1e826ed3", ), + ( + "pypi__pep517", + "https://files.pythonhosted.org/packages/f4/67/846c08e18fefb265a66e6fd5a34269d649b779718d9bf59622085dabd370/pep517-0.12.0-py2.py3-none-any.whl", + "dd884c326898e2c6e11f9e0b64940606a93eb10ea022a2e067959f3a110cf161", + ), ( "pypi__pip", "https://files.pythonhosted.org/packages/4d/16/0a14ca596f30316efd412a60bdfac02a7259bf8673d4d917dc60b9a21812/pip-22.0.4-py3-none-any.whl", @@ -29,14 +34,19 @@ _RULE_DEPS = [ ), ( "pypi__pip_tools", - "https://files.pythonhosted.org/packages/6d/16/75d65bdccd48bb59a08e2bf167b01d8532f65604270d0a292f0f16b7b022/pip_tools-5.5.0-py2.py3-none-any.whl", - "10841c1e56c234d610d0466447685b9ea4ee4a2c274f858c0ef3c33d9bd0d985", + "https://files.pythonhosted.org/packages/ba/42/5a9dfbaac47794c087d115fa275d3248a41614686b84d85cbb0bd146ebe5/pip_tools-6.6.0-py3-none-any.whl", + "66318bc2e884b61fafa1cb2cf01b35fdd779ab9ce82cc1bce277adb8cf3ab845", ), ( "pypi__setuptools", "https://files.pythonhosted.org/packages/7c/5b/3d92b9f0f7ca1645cba48c080b54fe7d8b1033a4e5720091d1631c4266db/setuptools-60.10.0-py3-none-any.whl", "782ef48d58982ddb49920c11a0c5c9c0b02e7d7d1c2ad0aa44e1a1e133051c96", ), + ( + "pypi__tomli", + "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", + "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + ), ( "pypi__wheel", "https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl", diff --git a/python/pip_install/requirements.bzl b/python/pip_install/requirements.bzl index 63fec01cfe..0035e7c8a2 100644 --- a/python/pip_install/requirements.bzl +++ b/python/pip_install/requirements.bzl @@ -60,9 +60,11 @@ def compile_pip_requirements( deps = [ requirement("click"), requirement("colorama"), + requirement("pep517"), requirement("pip"), requirement("pip_tools"), requirement("setuptools"), + requirement("tomli"), ] attrs = { diff --git a/python/versions.bzl b/python/versions.bzl index 1f18528336..2d05e1638d 100644 --- a/python/versions.bzl +++ b/python/versions.bzl @@ -47,6 +47,17 @@ TOOL_VERSIONS = { }, "strip_prefix": "python", }, + "3.8.13": { + "url": "20220502/cpython-{python_version}+20220502-{platform}-{build}.tar.gz", + "sha256": { + "aarch64-apple-darwin": "ba604867d8c6e0a1a85b1be789cad4c69af8a1699043f51e8a85998b55979127", + # no aarch64-unknown-linux-gnu build available for 3.8.13 + "x86_64-apple-darwin": "52e3541f41d165002e19a60e11dcc145e90ffe1fe8a6f94b17d5b72a674674ea", + "x86_64-pc-windows-msvc": "1435b77b4d89f2a99719918fcf917a67cd711cad46f67516bed2462d18fbefb3", + "x86_64-unknown-linux-gnu": "884c6c4605c11685164237bad5f8f2773edcf3abb0637a83efa7912a54f658b3", + }, + "strip_prefix": "python", + }, "3.9.10": { "url": "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz", "sha256": { @@ -58,6 +69,17 @@ TOOL_VERSIONS = { }, "strip_prefix": "python", }, + "3.9.12": { + "url": "20220502/cpython-{python_version}+20220502-{platform}-{build}.tar.gz", + "sha256": { + "aarch64-apple-darwin": "8dee06c07cc6429df34b6abe091a4684a86f7cec76f5d1ccc1c3ce2bd11168df", + "aarch64-unknown-linux-gnu": "2ee1426c181e65133e57dc55c6a685cb1fb5e63ef02d684b8a667d5c031c4203", + "x86_64-apple-darwin": "2453ba7f76b3df3310353b48c881d6cff622ba06e30d2b6ae91588b2bc9e481a", + "x86_64-pc-windows-msvc": "3024147fd987d9e1b064a3d94932178ff8e0fe98cfea955704213c0762fee8df", + "x86_64-unknown-linux-gnu": "ccca12f698b3b810d79c52f007078f520d588232a36bc12ede944ec3ea417816", + }, + "strip_prefix": "python", + }, "3.10.2": { "url": "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz", "sha256": { @@ -69,13 +91,24 @@ TOOL_VERSIONS = { }, "strip_prefix": "python", }, + "3.10.4": { + "url": "20220502/cpython-{python_version}+20220502-{platform}-{build}.tar.gz", + "sha256": { + "aarch64-apple-darwin": "2c99983d1e83e4b6e7411ed9334019f193fba626344a50c36fba6c25d4de78a2", + "aarch64-unknown-linux-gnu": "d8098c0c54546637e7516f93b13403b11f9db285def8d7abd825c31407a13d7e", + "x86_64-apple-darwin": "f2711eaffff3477826a401d09a013c6802f11c04c63ab3686aa72664f1216a05", + "x86_64-pc-windows-msvc": "bee24a3a5c83325215521d261d73a5207ab7060ef3481f76f69b4366744eb81d", + "x86_64-unknown-linux-gnu": "f6f871e53a7b1469c13f9bd7920ad98c4589e549acad8e5a1e14760fff3dd5c9", + }, + "strip_prefix": "python", + }, } # buildifier: disable=unsorted-dict-items MINOR_MAPPING = { - "3.8": "3.8.12", - "3.9": "3.9.10", - "3.10": "3.10.2", + "3.8": "3.8.13", + "3.9": "3.9.12", + "3.10": "3.10.4", } PLATFORMS = { diff --git a/tests/pip_repository_entry_points/requirements.txt b/tests/pip_repository_entry_points/requirements.txt index 146e9264ce..02bc8751b0 100644 --- a/tests/pip_repository_entry_points/requirements.txt +++ b/tests/pip_repository_entry_points/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # # bazel run //:requirements.update diff --git a/third_party/github.com/bazelbuild/bazel-skylib/lib/versions.bzl b/third_party/github.com/bazelbuild/bazel-skylib/lib/versions.bzl index 0209a6fae6..3cd60197aa 100644 --- a/third_party/github.com/bazelbuild/bazel-skylib/lib/versions.bzl +++ b/third_party/github.com/bazelbuild/bazel-skylib/lib/versions.bzl @@ -89,7 +89,7 @@ def _check_bazel_version(minimum_bazel_version, maximum_bazel_version = None, ba """ if not bazel_version: if "bazel_version" not in dir(native): - fail("Current Bazel version is lower than 0.2.1; expected at least {}".format( + fail("Bazel version cannot be determined; expected at least {}".format( minimum_bazel_version, )) elif not native.bazel_version: