You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An urlspec dependency with environment makers when used in a pyproject.toml dependecies section
is reported as a pep508 rule. When same dependency is used in a requirements.txt file it is installed correctly.
Regular pacakge dependecies with environment makers do not cause the error.
Example urlspec dependency with environment markers: torch @ https://download.pytorch.org/whl/cpu/torch-2.3.1%2Bcpu-cp311-cp311-linux_x86_64.whl; platform_system == 'Linux' and platform_machine == 'x86_64'
pip install . --verbose
=>
Running command Getting requirements to build wheel
configuration error: `project.dependencies[13]` must be pep508
DESCRIPTION:
Project dependency specification according to PEP 508
GIVEN VALUE:
"torch @ https://download.pytorch.org/whl/cpu/torch-2.3.1%2Bcpu-cp311-cp311-linux_x86_64.whl#sha256=a272defe305dbd944aa28a91cc3db0f0149495b3ebec2e39723a7224fa05dc57; platform_system == 'Linux' and platform_machine == 'x86_64'"
OFFENDING RULE: 'format'
DEFINITION:
{
"$id": "#/definitions/dependency",
"title": "Dependency",
"type": "string",
"format": "pep508"
}
For more details about `format` see
https://validate-pyproject.readthedocs.io/en/latest/api/validate_pyproject.formats.html
Expected behavior
The urlspec dependency must be installed on the respective system specified by environment markers.
According to following grammar rule:
quoted_marker can optionally be added after urlspec
url_req = (name:n wsp* extras?:e wsp* urlspec:v (wsp+ | end) quoted_marker?:m
-> (n, e or [], v, m))
pip version
24.2
Python version
3.11
OS
Mac OS arm64, linux x86_64
How to Reproduce
Create a pyproject.toml example file submitted above.
Run pip install -e . --verbose in the same directory
Output
Obtaining file:///Users/dre/src/pers_behaviour-cluster-ranking/pkg Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... error error: subprocess-exited-with-error × Getting requirements to build editable did not run successfully. │ exit code: 1 ╰─> [56 lines of output] configuration error: `project.dependencies[13]` must be pep508 DESCRIPTION: Project dependency specification according to PEP 508 GIVEN VALUE: "torch @ https://download.pytorch.org/whl/cpu/torch-2.3.1%2Bcpu-cp311-cp311-linux_x86_64.whl; platform_system == 'Linux' and platform_machine == 'x86_64'" OFFENDING RULE: 'format' DEFINITION: { "$id": "#/definitions/dependency", "title": "Dependency", "type": "string", "format": "pep508" } For more details about `format` see https://validate-pyproject.readthedocs.io/en/latest/api/validate_pyproject.formats.html Traceback (most recent call last): File "/Users/dre/src/pers_behaviour-cluster-ranking/pkg/.direnv/python-3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/Users/dre/src/pers_behaviour-cluster-ranking/pkg/.direnv/python-3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/dre/src/pers_behaviour-cluster-ranking/pkg/.direnv/python-3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 477, in get_requires_for_build_editable return self.get_requires_for_build_wheel(config_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires self.run_setup() File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 318, in run_setup exec(code, locals()) File "<string>", line 1, in <module> File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 157, in setup dist.parse_config_files() File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 647, in parse_config_files pyprojecttoml.apply_configuration(self, filename, ignore_option_errors) File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 71, in apply_configuration config = read_configuration(filepath, True, ignore_option_errors, dist) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 139, in read_configuration validate(subset, filepath) File "/private/var/folders/hq/6tp22gmj3ss5j2dw42q6m0dc2wv_r8/T/pip-build-env-bp2kzi38/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 60, in validate raise ValueError(f"{error}\n{summary}") from None ValueError: invalid pyproject.toml config: `project.dependencies[13]`. configuration error: `project.dependencies[13]` must be pep508 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip.error: subprocess-exited-with-error× Getting requirements to build editable did not run successfully.│ exit code: 1╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
dre-hh
changed the title
Urlspec dependency with environment markers within pyproject.toml dependcies is reported as pep508 offending rule
Urlspec dependency with environment markers within pyproject.toml dependencies section is reported as pep508 offending rule
Oct 17, 2024
As the note in the output says, this error is not coming from pip, but from a subprocess - in this case, setuptools (your build backend). It looks like the problem is actually in validate-pyproject (a dependency of setuptools) so I'd start by reporting this issue to them.
Description
An urlspec dependency with environment makers when used in a pyproject.toml dependecies section
is reported as a pep508 rule. When same dependency is used in a requirements.txt file it is installed correctly.
Regular pacakge dependecies with environment makers do not cause the error.
Example urlspec dependency with environment markers:
torch @ https://download.pytorch.org/whl/cpu/torch-2.3.1%2Bcpu-cp311-cp311-linux_x86_64.whl; platform_system == 'Linux' and platform_machine == 'x86_64'
Example pyproject.toml:
Expected behavior
The urlspec dependency must be installed on the respective system specified by environment markers.
According to following grammar rule:
quoted_marker can optionally be added after urlspec
pip version
24.2
Python version
3.11
OS
Mac OS arm64, linux x86_64
How to Reproduce
pip install -e . --verbose
in the same directoryOutput
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
Code of Conduct
The text was updated successfully, but these errors were encountered: