Skip to content

Commit e890a5a

Browse files
committed
fix: correct the implementation of multi_pip_parse
1 parent 35e763c commit e890a5a

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

examples/multi_python_versions/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ multi_pip_parse(
3838
default_version = default_python_version,
3939
python_interpreter_target = {
4040
"3.10": interpreter_3_10,
41-
"3.11": interpreter_3_11,
41+
"3.11.1": interpreter_3_11,
4242
"3.8": interpreter_3_8,
4343
"3.9": interpreter_3_9,
4444
},
4545
requirements_lock = {
4646
"3.10": "//requirements:requirements_lock_3_10.txt",
47-
"3.11": "//requirements:requirements_lock_3_11.txt",
47+
"3.11.1": "//requirements:requirements_lock_3_11.txt",
4848
"3.8": "//requirements:requirements_lock_3_8.txt",
4949
"3.9": "//requirements:requirements_lock_3_9.txt",
5050
},

examples/multi_python_versions/libs/my_lib/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@
1616

1717

1818
def websockets_is_for_python_version(sanitized_version_check):
19-
return f"pypi_{sanitized_version_check}_websockets" in websockets.__file__
19+
# We are checking that the name of the repository folders
20+
# match the expexted generated names. If we update the folder
21+
# structure or naming we will need to modify this test
22+
if f"pypi_{sanitized_version_check}_websockets" in websockets.__file__:
23+
return True
24+
25+
raise RuntimeError(
26+
f"Expected version '{sanitized_version_check}' was not in {websockets.__file__}"
27+
)

python/pip.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ _process_requirements(
185185
repo_prefix = "{pypi_repository}_",
186186
)""".format(
187187
pypi_repository = pypi_repository,
188-
python_version = version_label(python_version, sep = "."),
188+
python_version = python_version,
189189
sanitized_python_version = sanitized_python_version,
190190
)
191191
process_requirements_calls.append(process_requirements_call)
@@ -246,7 +246,7 @@ def install_deps(**whl_library_kwargs):
246246
load_statements = "\n".join(load_statements),
247247
process_requirements_calls = "\n".join(process_requirements_calls),
248248
rules_python = rules_python,
249-
default_version = rctx.attr.default_version,
249+
default_version = full_version(rctx.attr.default_version),
250250
)
251251
rctx.file("requirements.bzl", requirements_bzl)
252252
rctx.file("BUILD.bazel", "exports_files(['requirements.bzl'])")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy