Skip to content

Commit

Permalink
feat: implementation capitalized name
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jul 5, 2024
1 parent da8cb21 commit 4071a93
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/dep_logic/tags/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ def short(self) -> str:
else:
return "pt"

@property
def capitalized(self) -> str:
if self.name == "pypy":
return "PyPy"
elif self.name == "pyston":
return "Pyston"
else:
return "CPython"

@classmethod
def current(cls) -> Self:
import sysconfig
Expand Down Expand Up @@ -226,7 +235,11 @@ def markers(self) -> dict[str, str]:
if self.platform is not None:
result.update(self.platform.markers())
if self.implementation is not None:
result["implementation_name"] = self.implementation.name
result.update(
implementation_name=self.implementation.name,
platform_python_implementation=self.implementation.capitalized,
)

return result

def compare(self, target: EnvSpec) -> EnvCompatibility:
Expand Down

0 comments on commit 4071a93

Please sign in to comment.