MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / requirement

Function requirement

scripts/utils/check-dist.py:65–74  ·  view source on GitHub ↗

`text` as hatchling writes it

(text: str, extra: str | None = None)

Source from the content-addressed store, hash-verified

63
64
65def requirement(text: str, extra: str | None = None) -> str:
66 """`text` as hatchling writes it"""
67 match = re.fullmatch(r"([\w.-]+) *(\[.*?\])? *([^;]*?) *(?:; *(.*))?", text)
68 assert match, text
69 name, extras, bounds, marker = match.groups("")
70 marker = marker.replace('"', "'")
71 if extra:
72 marker = (f"({marker}) and " if marker else "") + f"extra == '{extra}'"
73 name = re.sub(r"[-_.]+", "-", name).lower()
74 return name + extras + version_bounds(bounds) + (f"; {marker}" if marker else "")
75
76
77def expected_metadata(pyproject: dict[str, Any], version: str) -> tuple[list[str], str]:

Callers 1

expected_metadataFunction · 0.85

Calls 1

version_boundsFunction · 0.85

Tested by

no test coverage detected