-
-
Notifications
You must be signed in to change notification settings - Fork 639
fix(pip): do not add a pip-fallback when there is no sdist #3432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
df6eb5d
1324766
a82f384
1a0950d
250ac17
799ae46
88edf3d
13ae030
31ec6bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -566,6 +566,9 @@ def _test_torch_experimental_index_url(env): | |
| for (os, cpu), whl_platform_tags in { | ||
| ("linux", "x86_64"): ["linux_x86_64", "manylinux_*_x86_64"], | ||
| ("linux", "aarch64"): ["linux_aarch64", "manylinux_*_aarch64"], | ||
| # this should be ignored as well because there is no sdist and no whls | ||
| # for intel Macs | ||
| ("osx", "x86_64"): ["macosx_*_x86_64"], | ||
| ("osx", "aarch64"): ["macosx_*_arm64"], | ||
| ("windows", "x86_64"): ["win_amd64"], | ||
| ("windows", "aarch64"): ["win_arm64"], # this should be ignored | ||
|
|
@@ -576,15 +579,6 @@ def _test_torch_experimental_index_url(env): | |
| "python_3_12_host": "unit_test_interpreter_target", | ||
| }, | ||
| minor_mapping = {"3.12": "3.12.19"}, | ||
| evaluate_markers_fn = lambda _, requirements, **__: { | ||
| # todo once 2692 is merged, this is going to be easier to test. | ||
| key: [ | ||
| platform | ||
| for platform in platforms | ||
| if ("x86_64" in platform and "platform_machine ==" in key) or ("x86_64" not in platform and "platform_machine !=" in key) | ||
| ] | ||
| for key, platforms in requirements.items() | ||
| }, | ||
| simpleapi_download_fn = mocksimpleapi_download, | ||
| ) | ||
| builder.pip_parse( | ||
|
|
@@ -621,7 +615,6 @@ torch==2.4.1+cpu ; platform_machine == 'x86_64' \ | |
| _parse( | ||
| hub_name = "pypi", | ||
| python_version = "3.12", | ||
| download_only = True, | ||
| experimental_index_url = "https://torch.index", | ||
| requirements_lock = "universal.txt", | ||
| ), | ||
|
|
@@ -800,6 +793,20 @@ def _test_simple_get_index(env): | |
| got_simpleapi_download_args.extend(args) | ||
| got_simpleapi_download_kwargs.update(kwargs) | ||
| return { | ||
| "plat_pkg": struct( | ||
| whls = { | ||
| "deadb44f": struct( | ||
| yanked = False, | ||
| filename = "plat-pkg-0.0.4-py3-none-linux_x86_64.whl", | ||
| sha256 = "deadb44f", | ||
| url = "example2.org/index/plat_pkg/", | ||
| ), | ||
| }, | ||
| sdists = {}, | ||
| sha256s_by_version = { | ||
| "0.0.4": ["deadb44f"], | ||
| }, | ||
| ), | ||
| "simple": struct( | ||
| whls = { | ||
| "deadb00f": struct( | ||
|
|
@@ -850,6 +857,7 @@ some_pkg==0.0.1 @ example-direct.org/some_pkg-0.0.1-py3-none-any.whl \ | |
| --hash=sha256:deadbaaf | ||
| direct_without_sha==0.0.1 @ example-direct.org/direct_without_sha-0.0.1-py3-none-any.whl | ||
| some_other_pkg==0.0.1 | ||
| plat_pkg==0.0.4 | ||
| pip_fallback==0.0.1 | ||
| direct_sdist_without_sha @ some-archive/any-name.tar.gz | ||
| git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef | ||
|
|
@@ -873,6 +881,7 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef | |
| "direct_without_sha", | ||
| "git_dep", | ||
| "pip_fallback", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The package |
||
| "plat_pkg", | ||
| "simple", | ||
| "some_other_pkg", | ||
| "some_pkg", | ||
|
|
@@ -921,6 +930,17 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef | |
| ), | ||
| ], | ||
| }, | ||
| "plat_pkg": { | ||
| "pypi_315_plat_py3_none_linux_x86_64_deadb44f": [ | ||
| whl_config_setting( | ||
| target_platforms = [ | ||
| "cp315_linux_x86_64", | ||
| "cp315_linux_x86_64_freethreaded", | ||
| ], | ||
| version = "3.15", | ||
| ), | ||
| ], | ||
| }, | ||
| "simple": { | ||
| "pypi_315_simple_py3_none_any_deadb00f": [ | ||
| whl_config_setting( | ||
|
|
@@ -998,6 +1018,15 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef | |
| "python_interpreter_target": "unit_test_interpreter_target", | ||
| "requirement": "pip_fallback==0.0.1", | ||
| }, | ||
| "pypi_315_plat_py3_none_linux_x86_64_deadb44f": { | ||
| "config_load": "@pypi//:config.bzl", | ||
| "dep_template": "@pypi//{name}:{target}", | ||
| "filename": "plat-pkg-0.0.4-py3-none-linux_x86_64.whl", | ||
| "python_interpreter_target": "unit_test_interpreter_target", | ||
| "requirement": "plat_pkg==0.0.4", | ||
| "sha256": "deadb44f", | ||
| "urls": ["example2.org/index/plat_pkg/"], | ||
| }, | ||
| "pypi_315_simple_py3_none_any_deadb00f": { | ||
| "config_load": "@pypi//:config.bzl", | ||
| "dep_template": "@pypi//{name}:{target}", | ||
|
|
@@ -1036,7 +1065,7 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef | |
| index_url = "pypi.org", | ||
| index_url_overrides = {}, | ||
| netrc = None, | ||
| sources = ["simple", "pip_fallback", "some_other_pkg"], | ||
| sources = ["simple", "plat_pkg", "pip_fallback", "some_other_pkg"], | ||
| ), | ||
| "cache": {}, | ||
| "parallel_download": False, | ||
|
|
@@ -1048,14 +1077,6 @@ _tests.append(_test_simple_get_index) | |
| def _test_optimum_sys_platform_extra(env): | ||
| builder = hub_builder( | ||
| env, | ||
| evaluate_markers_fn = lambda _, requirements, **__: { | ||
| key: [ | ||
| platform | ||
| for platform in platforms | ||
| if ("darwin" in key and "osx" in platform) or ("linux" in key and "linux" in platform) | ||
| ] | ||
| for key, platforms in requirements.items() | ||
| }, | ||
| ) | ||
| builder.pip_parse( | ||
| _mock_mctx( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.