Skip to content

Commit

Permalink
fix: add python_version to markers if requires_python is ==
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jul 22, 2024
1 parent 3d42a38 commit 77dfb37
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/dep_logic/tags/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from platform import python_implementation
from typing import TYPE_CHECKING

from dep_logic.specifiers.range import RangeSpecifier

from ..specifiers import InvalidSpecifier, VersionSpecifier, parse_version_specifier
from .platform import Platform

Expand Down Expand Up @@ -235,6 +237,15 @@ def wheel_compatibility(

def markers(self) -> dict[str, str]:
result = {}
if (
isinstance(self.requires_python, RangeSpecifier)
and (version := self.requires_python.min) is not None
and version == self.requires_python.max
):
result.update(
python_version=f"{version.major}.{version.minor}",
python_full_version=str(version),
)
if self.platform is not None:
result.update(self.platform.markers())
if self.implementation is not None:
Expand Down

0 comments on commit 77dfb37

Please sign in to comment.