-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption). -
OS version and name: MAC OS BigSur
-
Poetry version: Poetry version 1.1.12
-
Reproducible code: https://github.com/stonelazy/poetry-path-issue
-
Issue
-
.whl file generated using poetry build throws error when trying to install.
-
Steps to reproduce this issue
git clone https://github.com/stonelazy/poetry-path-issue
cd poetry-path-issue
poetry build
pip install dist/appname-1-py3-none-any.whl -vvv -
Expected result
- whl gets installed without any error. -
Issue faced
- Exception trace thrown when invoking pip install of the .whl file -
Issue Description
- This issue occurs only when a another local path dependency is kept. Suppose the line L13 is removed, then there is no issue.
- Including of this local path is correct according to https://python-poetry.org/docs/dependency-specification/#path-dependencies
-
ERROR: Exception:
Traceback (most recent call last):
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3021, in _dep_map
return self.__dep_map
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3101, in __init__
super(Requirement, self).__init__(requirement_string)
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/packaging/requirements.py", line 117, in __init__
raise InvalidRequirement(f"Invalid URL: {req.url}")
pip._vendor.packaging.requirements.InvalidRequirement: Invalid URL: appname-pkg3
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
status = self.run(options, args)
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
return func(self, options, args)
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 315, in run
requirement_set = resolver.resolve(
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 366, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 212, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 202, in _get_updated_criteria
for requirement in self._p.get_dependencies(candidate=candidate):
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 197, in get_dependencies
return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 197, in <listcomp>
return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 250, in iter_dependencies
requires = self.dist.requires() if with_requires else ()
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2736, in requires
dm = self._dep_map
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3033, in _compute_dependencies
reqs.extend(parse_requirements(req))
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3094, in parse_requirements
yield Requirement(line)
File "/Users/sudharsan-2598/opt/anaconda3/envs/npsp6/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3103, in __init__
raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid URL: appname-pkg3
- Tree of the repo
├── README.md
├── appname
│ └── pkg1
│ ├── __init__.py
│ └── sample.py
├── appname-pkg3
│ ├── appname
│ │ └── pkg3
│ │ ├── __init__.py
│ │ └── sample.py
│ └── pyproject.toml
├── dist
│ ├── appname-1-py3-none-any.whl
│ └── appname-1.tar.gz
├── error.txt
├── poetry.lock
└── pyproject.toml
-
Expected Result:
- Installation gets completed and that i would be able to do following the python import.
from appname.pkg3 import sample from appname.pkg1 import sample -
Why should this be a poetry issue and not something wrong with the code ?
- If i do poetry lock and then poetry install then i don't face any issue.