Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/3396.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug, that prevented the installation of extra dependencies, which contain an underscore in their identifier.
3 changes: 2 additions & 1 deletion src/tox/tox_env/python/virtual_env/package/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from cachetools import cached
from packaging.requirements import Requirement
from packaging.utils import canonicalize_name
from pyproject_api import (
BackendFailed,
CmdStatus,
Expand Down Expand Up @@ -313,7 +314,7 @@ def _load_deps_from_static(self, for_env: EnvConfigSet) -> list[Requirement] | N
]
optional_deps = project.get("optional-dependencies", {})
for extra, reqs in optional_deps.items():
deps_with_markers.extend((Requirement(req), {extra}) for req in (reqs or []))
deps_with_markers.extend((Requirement(req), {canonicalize_name(extra)}) for req in (reqs or []))
return dependencies_with_extras_from_markers(
deps_with_markers=deps_with_markers,
extras=extras,
Expand Down