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
When the package python constraint(e.g. We want flake8 for python >=3.6 only, it doesn't overlap with dep python constraint(e.g. configparser is only needed for python <3.2), it means configparser is not required at all and shouldn't be listed in the lock result. However, in this case poetry will throw a Could not parse version constraint: <empty> error because the intersection version is <empty>.
Error detail:
Traceback (most recent call last):
File "/Users/fming/.virtualenvs/poetry-ZHUPScpV-py3.7/lib/python3.7/site-packages/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/Users/fming/.virtualenvs/poetry-ZHUPScpV-py3.7/lib/python3.7/site-packages/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/Users/fming/.virtualenvs/poetry-ZHUPScpV-py3.7/lib/python3.7/site-packages/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/Users/fming/.virtualenvs/poetry-ZHUPScpV-py3.7/lib/python3.7/site-packages/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/Users/fming/wkspace/github/poetry/poetry/console/commands/add.py", line 149, in handle
status = installer.run()
File "/Users/fming/wkspace/github/poetry/poetry/installation/installer.py", line 74, in run
self._do_install(local_repo)
File "/Users/fming/wkspace/github/poetry/poetry/installation/installer.py", line 161, in _do_install
ops = solver.solve(use_latest=self._whitelist)
File "/Users/fming/wkspace/github/poetry/poetry/puzzle/solver.py", line 36, in solve
packages, depths = self._solve(use_latest=use_latest)
File "/Users/fming/wkspace/github/poetry/poetry/puzzle/solver.py", line 181, in _solve
self._package, self._provider, locked=locked, use_latest=use_latest
File "/Users/fming/wkspace/github/poetry/poetry/mixology/__init__.py", line 7, in resolve_version
return solver.solve()
File "/Users/fming/wkspace/github/poetry/poetry/mixology/version_solver.py", line 80, in solve
next = self._choose_package_version()
File "/Users/fming/wkspace/github/poetry/poetry/mixology/version_solver.py", line 378, in _choose_package_version
version = self._provider.complete_package(version)
File "/Users/fming/wkspace/github/poetry/poetry/puzzle/provider.py", line 678, in complete_package
package.dependency.python_constraint
File "/Users/fming/wkspace/github/poetry/poetry/packages/dependency.py", line 118, in transitive_python_versions
self._transitive_python_constraint = parse_constraint(value)
File "/Users/fming/wkspace/github/poetry/poetry/semver/__init__.py", line 31, in parse_constraint
constraint_objects.append(parse_single_constraint(and_constraints[0]))
File "/Users/fming/wkspace/github/poetry/poetry/semver/__init__.py", line 164, in parse_single_constraint
raise ValueError('Could not parse version constraint: {}'.format(constraint))
-vvv
option).Issue
The following lines:
poetry/poetry/puzzle/provider.py
Lines 676 to 680 in 06cdc77
When the package python constraint(e.g. We want
flake8
for python>=3.6
only, it doesn't overlap with dep python constraint(e.g.configparser
is only needed for python<3.2
), it meansconfigparser
is not required at all and shouldn't be listed in the lock result. However, in this casepoetry
will throw aCould not parse version constraint: <empty>
error because the intersection version is<empty>
.Error detail:
Steps to replicate
$ poetry add -D -vvv --python ">=3.6" pytest
Possible related:
#1484
The text was updated successfully, but these errors were encountered: