Read requirements from pyproject.toml.
This commit is contained in:
parent
40aa791ec1
commit
9792ddb865
1 changed files with 8 additions and 3 deletions
|
@ -362,6 +362,11 @@ class PyProject(BuildSystem):
|
||||||
return
|
return
|
||||||
raise AssertionError("no supported section in pyproject.toml")
|
raise AssertionError("no supported section in pyproject.toml")
|
||||||
|
|
||||||
|
def get_declared_dependencies(self):
|
||||||
|
if "build-system" in self.pyproject:
|
||||||
|
for require in self.pyproject['build-system'].get("requires", []):
|
||||||
|
yield "build", PythonPackageRequirement.from_requirement_str(require)
|
||||||
|
|
||||||
|
|
||||||
class SetupCfg(BuildSystem):
|
class SetupCfg(BuildSystem):
|
||||||
|
|
||||||
|
@ -730,12 +735,12 @@ def detect_buildsystems(path, trust_package=False): # noqa: C901
|
||||||
if os.path.exists(os.path.join(path, "setup.py")):
|
if os.path.exists(os.path.join(path, "setup.py")):
|
||||||
logging.debug("Found setup.py, assuming python project.")
|
logging.debug("Found setup.py, assuming python project.")
|
||||||
yield SetupPy(os.path.join(path, "setup.py"))
|
yield SetupPy(os.path.join(path, "setup.py"))
|
||||||
elif os.path.exists(os.path.join(path, "pyproject.toml")):
|
|
||||||
logging.debug("Found pyproject.toml, assuming python project.")
|
|
||||||
yield PyProject(os.path.join(path, "pyproject.toml"))
|
|
||||||
elif os.path.exists(os.path.join(path, "setup.cfg")):
|
elif os.path.exists(os.path.join(path, "setup.cfg")):
|
||||||
logging.debug("Found setup.cfg, assuming python project.")
|
logging.debug("Found setup.cfg, assuming python project.")
|
||||||
yield SetupCfg(os.path.join(path, "setup.cfg"))
|
yield SetupCfg(os.path.join(path, "setup.cfg"))
|
||||||
|
if os.path.exists(os.path.join(path, "pyproject.toml")):
|
||||||
|
logging.debug("Found pyproject.toml, assuming python project.")
|
||||||
|
yield PyProject(os.path.join(path, "pyproject.toml"))
|
||||||
|
|
||||||
if os.path.exists(os.path.join(path, "package.json")):
|
if os.path.exists(os.path.join(path, "package.json")):
|
||||||
logging.debug("Found package.json, assuming node package.")
|
logging.debug("Found package.json, assuming node package.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue