Skip to content

Commit

Permalink
Updated pip, pkginfo, setuptools, and wheel. (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre authored Mar 20, 2022
1 parent 0f18997 commit fe30f15
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
10 changes: 10 additions & 0 deletions examples/pip_repository_annotations/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,6 +50,7 @@ write_file(
pip_parse(
name = "pip_parsed",
annotations = ANNOTATIONS,
python_interpreter_target = interpreter,
requirements_lock = "//:requirements.txt",
)

Expand All @@ -53,5 +62,6 @@ install_deps()
pip_install(
name = "pip_installed",
annotations = ANNOTATIONS,
python_interpreter_target = interpreter,
requirements = "//:requirements.txt",
)
9 changes: 9 additions & 0 deletions examples/relative_requirements/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
16 changes: 8 additions & 8 deletions python/pip_install/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
),
]

Expand Down
12 changes: 12 additions & 0 deletions tests/pip_repository_entry_points/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand All @@ -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",
)

0 comments on commit fe30f15

Please sign in to comment.