MCPcopy
hub / github.com/pex-tool/pex / main

Function main

scripts/requires-python-check.py:11–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def main() -> Any:
12 config_parser = ConfigParser()
13 config_parser.read("setup.cfg")
14 setup_cfg_python_requires = config_parser.get("options", "python_requires")
15
16 pyproject_data = toml.load("pyproject.toml")
17 pyproject_requires_python = pyproject_data["project"]["requires-python"]
18
19 if setup_cfg_python_requires != pyproject_requires_python:
20 return dedent(
21 """\
22 The project Requires-Python metadata is inconsistent. Please align the following values:
23
24 setup.cfg:
25 [options]
26 python_requires = {setup_cfg_python_requires}
27
28 pyproject.toml:
29 [project]
30 requires-python = "{pyproject_requires_python}"
31 """.format(
32 setup_cfg_python_requires=setup_cfg_python_requires,
33 pyproject_requires_python=pyproject_requires_python,
34 )
35 )
36
37
38if __name__ == "__main__":

Callers 1

Calls 3

readMethod · 0.45
getMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected