From fe30f1561e3afef59e3f8be6339c88444100de25 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Sun, 20 Mar 2022 12:54:28 -0700 Subject: [PATCH] Updated `pip`, `pkginfo`, `setuptools`, and `wheel`. (#661) --- examples/pip_repository_annotations/WORKSPACE | 10 ++++++++++ examples/relative_requirements/WORKSPACE | 9 +++++++++ python/pip_install/repositories.bzl | 16 ++++++++-------- tests/pip_repository_entry_points/WORKSPACE | 12 ++++++++++++ 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/examples/pip_repository_annotations/WORKSPACE b/examples/pip_repository_annotations/WORKSPACE index 8c0146139e..eb712cfc6b 100644 --- a/examples/pip_repository_annotations/WORKSPACE +++ b/examples/pip_repository_annotations/WORKSPACE @@ -16,6 +16,14 @@ http_archive( ], ) +load("@rules_python//python:repositories.bzl", "python_register_toolchains") + +python_register_toolchains( + name = "python39", + python_version = "3.9", +) + +load("@python39//:defs.bzl", "interpreter") load("@rules_python//python:pip.bzl", "package_annotation", "pip_install", "pip_parse") # Here we can see an example of annotations being applied to an arbitrary @@ -42,6 +50,7 @@ write_file( pip_parse( name = "pip_parsed", annotations = ANNOTATIONS, + python_interpreter_target = interpreter, requirements_lock = "//:requirements.txt", ) @@ -53,5 +62,6 @@ install_deps() pip_install( name = "pip_installed", annotations = ANNOTATIONS, + python_interpreter_target = interpreter, requirements = "//:requirements.txt", ) diff --git a/examples/relative_requirements/WORKSPACE b/examples/relative_requirements/WORKSPACE index 0f2da3131c..4ae91c39d8 100644 --- a/examples/relative_requirements/WORKSPACE +++ b/examples/relative_requirements/WORKSPACE @@ -5,8 +5,17 @@ local_repository( path = "../..", ) +load("@rules_python//python:repositories.bzl", "python_register_toolchains") + +python_register_toolchains( + name = "python39", + python_version = "3.9", +) + +load("@python39//:defs.bzl", "interpreter") load("@rules_python//python:pip.bzl", "pip_install") pip_install( + python_interpreter_target = interpreter, requirements = "//:requirements.txt", ) diff --git a/python/pip_install/repositories.bzl b/python/pip_install/repositories.bzl index 942711d0c2..352f66341c 100644 --- a/python/pip_install/repositories.bzl +++ b/python/pip_install/repositories.bzl @@ -19,8 +19,8 @@ _RULE_DEPS = [ ), ( "pypi__pip", - "https://files.pythonhosted.org/packages/47/ca/f0d790b6e18b3a6f3bd5e80c2ee4edbb5807286c21cdd0862ca933f751dd/pip-21.1.3-py3-none-any.whl", - "78cb760711fedc073246543801c84dc5377affead832e103ad0211f99303a204", + "https://files.pythonhosted.org/packages/4d/16/0a14ca596f30316efd412a60bdfac02a7259bf8673d4d917dc60b9a21812/pip-22.0.4-py3-none-any.whl", + "c6aca0f2f081363f689f041d90dab2a07a9a07fb840284db2218117a52da800b", ), ( "pypi__pip_tools", @@ -29,18 +29,18 @@ _RULE_DEPS = [ ), ( "pypi__pkginfo", - "https://files.pythonhosted.org/packages/77/83/1ef010f7c4563e218854809c0dff9548de65ebec930921dedf6ee5981f27/pkginfo-1.7.1-py2.py3-none-any.whl", - "37ecd857b47e5f55949c41ed061eb51a0bee97a87c969219d144c0e023982779", + "https://files.pythonhosted.org/packages/cd/00/49f59cdd2c6a52e6665fda4de671dac5614366dc827e050c55428241b929/pkginfo-1.8.2-py2.py3-none-any.whl", + "c24c487c6a7f72c66e816ab1796b96ac6c3d14d49338293d2141664330b55ffc", ), ( "pypi__setuptools", - "https://files.pythonhosted.org/packages/a2/e1/902fbc2f61ad6243cd3d57ffa195a9eb123021ec912ec5d811acf54a39f8/setuptools-57.1.0-py3-none-any.whl", - "ddae4c1b9220daf1e32ba9d4e3714df6019c5b583755559be84ff8199f7e1fe3", + "https://files.pythonhosted.org/packages/7c/5b/3d92b9f0f7ca1645cba48c080b54fe7d8b1033a4e5720091d1631c4266db/setuptools-60.10.0-py3-none-any.whl", + "782ef48d58982ddb49920c11a0c5c9c0b02e7d7d1c2ad0aa44e1a1e133051c96", ), ( "pypi__wheel", - "https://files.pythonhosted.org/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl", - "78b5b185f0e5763c26ca1e324373aadd49182ca90e825f7853f4b2509215dc0e", + "https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl", + "4bdcd7d840138086126cd09254dc6195fb4fc6f01c050a1d7236f2630db1d22a", ), ] diff --git a/tests/pip_repository_entry_points/WORKSPACE b/tests/pip_repository_entry_points/WORKSPACE index 5b893f5319..07a5d3aad0 100644 --- a/tests/pip_repository_entry_points/WORKSPACE +++ b/tests/pip_repository_entry_points/WORKSPACE @@ -5,11 +5,22 @@ local_repository( path = "../..", ) +load("@rules_python//python:repositories.bzl", "python_register_toolchains") + +# This toolchain is explicitly 3.10 while `rules_python` is 3.9 to act as +# a regression test, ensuring 3.10 is functional +python_register_toolchains( + name = "python310", + python_version = "3.10", +) + +load("@python310//:defs.bzl", "interpreter") load("@rules_python//python:pip.bzl", "pip_install", "pip_parse") # For a more thorough example of `pip_parse`. See `@rules_python//examples/pip_parse` pip_parse( name = "pip_parsed", + python_interpreter_target = interpreter, requirements_lock = "//:requirements.txt", ) @@ -20,5 +31,6 @@ install_deps() # For a more thorough example of `pip_install`. See `@rules_python//examples/pip_install` pip_install( name = "pip_installed", + python_interpreter_target = interpreter, requirements = "//:requirements.txt", )