-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Specifying 'extras' with remote wheel causes exception #5536
Comments
Can this be rechecked with |
This still happens on the latest release.
Looks like a bug in requirementslib. |
Adding some more information I found out trying to debug this:
|
OK. This is definitely a bug in requirementslib:
|
Suspected cause of problem: The constraints from:
are written to:
|
I stumbled over the same issue when trying to install a wheel for the ray library. From my pipfile:
Gave me this error:
Originally i tried to replicate this line for the installation through pip:
When installing the url through the command line without extras the installations works:
pipenv, version 2022.12.19 |
Requirements with a wheel path with extras caused a constraint line with egg name which was included twice. For example: ``` 'spacy = {file = "https://files.pythonhosted.org/packages/.../spacy-3.4.3-cp39-..._x86_64.whl", extras = ["transformers"]}' ``` Produced a constraint line like the following: ``` https://files.pythonhosted.org/.../spacy-3.4.3-..._x86_64.whl#egg=spacy#egg=spacy[transformers] ``` This line triggered an unhandled excpetion `pipenv.exceptions.ResolutionFailure`, as in #5536. The should be submitted actually to requirementslib. However, I am publishing it here so others can confirm it too. Signed-off-by: Oz Tiram <[email protected]>
@elanou @Blubberblub I have published a branch with a commit that fixes this issue. Please see the detailed commit message, as for why this is still not merged. You can, however, test already the changes. |
Requirements with a wheel path with extras caused a constraint line with egg name which was included twice. For example: ``` 'spacy = {file = "https://files.pythonhosted.org/packages/.../spacy-3.4.3-cp39-..._x86_64.whl", extras = ["transformers"]}' ``` Produced a constraint line like the following: ``` https://files.pythonhosted.org/.../spacy-3.4.3-..._x86_64.whl#egg=spacy#egg=spacy[transformers] ``` This line triggered an unhandled excpetion `pipenv.exceptions.ResolutionFailure`, as in pypa/pipenv#5536. Signed-off-by: Oz Tiram <[email protected]>
Fix #5536. Bump vendored requirementslib to 2.2.3 which includes the actual fix. Also, add a test case for this in pipenv.
Issue description
Trying to install wheel from remote file with 'extras' specified in pipfile causes exception.
pipfile ex:
'spacy = {file = "https://files.pythonhosted.org/packages/8a/2a/fe2870e216511ed12b9b5acf89228abc0c76832b9572501e0b895a9e129d/spacy-3.4.3-cp39-cp39-macosx_10_9_x86_64.whl", extras = ["transformers"]}'
Expected result
Install wheel and extras
Actual result
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 102, in init
req = REQUIREMENT.parseString(requirement_string)
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/pyparsing/core.py", line 1141, in parse_string
raise exc.with_traceback(None)
pipenv.patched.pip._vendor.pyparsing.exceptions.ParseException: Expected string_end, found '#' (at char 12), (line:1, col:13)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/pkg_resources/init.py", line 3101, in init
super(Requirement, self).init(requirement_string)
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 104, in init
raise InvalidRequirement(
pipenv.patched.pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'#egg='": Expected string_end
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 275, in parse_line
req = Requirement.from_line(line)
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2684, in from_line
r = file_req_from_parsed_line(parsed_line)
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 3084, in file_req_from_parsed_line
"req": parsed_line.requirement,
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 475, in requirement
self.parse_requirement()
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1081, in parse_requirement
self._requirement = init_requirement(name) # type: PackagingRequirement
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/vendor/requirementslib/models/utils.py", line 192, in init_requirement
req = Requirement.parse(name)
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/pkg_resources/init.py", line 3148, in parse
req, = parse_requirements(s)
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/pkg_resources/init.py", line 3094, in parse_requirements
yield Requirement(line)
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/patched/pip/_vendor/pkg_resources/init.py", line 3103, in init
raise RequirementParseError(str(e))
pipenv.patched.pip._vendor.pkg_resources.RequirementParseError: Parse error at "'#egg='": Expected string_end
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 816, in
main()
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 802, in main
_main(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 782, in _main
resolve_packages(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 730, in resolve_packages
results, resolver = resolve(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/resolver.py", line 709, in resolve
return resolve_deps(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 1105, in resolve_deps
results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 891, in actually_resolve_deps
resolver = Resolver.create(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 460, in create
constraints, skipped, index_lookup, markers_lookup = resolver.get_metadata(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 219, in get_metadata
req, req_idx, markers_idx = self.parse_line(
File "/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv/utils/resolver.py", line 287, in parse_line
raise ResolutionFailure(
pipenv.exceptions.ResolutionFailure: ERROR: Failed to resolve requirement from line: https://files.pythonhosted.org/packages/8a/2a/fe2870e216511ed12b9b5acf89228abc0c76832b9572501e0b895a9e129d/spacy-3.4.3-cp39-cp39-macosx_10_9_x86_64.whl#egg=spacy-darwin#egg=[transformers]
✘ Locking Failed!
Steps to replicate
add below to pipfile:
'spacy = {file = "https://files.pythonhosted.org/packages/8a/2a/fe2870e216511ed12b9b5acf89228abc0c76832b9572501e0b895a9e129d/spacy-3.4.3-cp39-cp39-macosx_10_9_x86_64.whl", extras = ["transformers"]}'
Pipenv version:
'2022.9.24'
Pipenv location:
'/usr/local/Cellar/pipenv/2022.9.24/libexec/lib/python3.11/site-packages/pipenv'
Python location:
'/usr/local/Cellar/pipenv/2022.9.24/libexec/bin/python3.11'
OS Name:
'posix'
User pip version:
'22.2.2'
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.11.0',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '22.1.0',
'platform_system': 'Darwin',
'platform_version': 'Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT '
'2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103',
'python_full_version': '3.11.0',
'python_version': '3.11',
'sys_platform': 'darwin'}
The text was updated successfully, but these errors were encountered: