Issue
I'm not sure if this is a poetry bug or a tox bug, but I figured I'd start here. The issue seems to be with how:
|
def extract_extra_markers(deps: list[Requirement]) -> list[tuple[Requirement, set[str | None]]]: |
is parsing extras that fall into multiple extra groups. That is if you have the same requirement in 2+ extra groups, poetry will e.g., produce the line:
Requires-Dist: filelock (>=3.9.0,<4.0.0) ; extra == "extras1" or extra == "extras2"
in the PKG-INFO
Then when tox is run with e.g., extras = extras1, you get:
py-extras1: install_package_deps> python -I -m pip install 'filelock<4.0.0,>=3.9.0; or extra == "extras2"'
...
pip._vendor.packaging.markers.InvalidMarker: Invalid marker: 'or extra == "extras2"', parse error at 'or extra'
Environment
Provide at least:
- OS: macos
pip list of the host Python where tox is installed:
./.venv/bin/pip list
Package Version
------------- -------
cachetools 5.2.0
chardet 5.1.0
colorama 0.4.6
distlib 0.3.6
filelock 3.9.0
packaging 22.0
pip 22.3.1
platformdirs 2.6.2
pluggy 1.0.0
pyproject_api 1.2.1
setuptools 65.5.0
tox 4.1.0
virtualenv 20.17.1
Minimal example
I've created a minimal poetry project that reproduces this bug: https://github.com/dconathan/poetry-tox-bug
Issue
I'm not sure if this is a poetry bug or a tox bug, but I figured I'd start here. The issue seems to be with how:
tox/src/tox/tox_env/python/virtual_env/package/util.py
Line 31 in c838192
is parsing extras that fall into multiple extra groups. That is if you have the same requirement in 2+ extra groups, poetry will e.g., produce the line:
in the
PKG-INFOThen when
toxis run with e.g.,extras = extras1, you get:Environment
Provide at least:
pip listof the host Python wheretoxis installed:Minimal example
I've created a minimal poetry project that reproduces this bug: https://github.com/dconathan/poetry-tox-bug