mirror of
https://github.com/frappe/bench.git
synced 2025-02-02 10:58:24 +00:00
fix: use optional-dependencies as preferred variant to custom dev-dependencies
This commit is contained in:
parent
af8ed34201
commit
dc0768819b
@ -97,8 +97,15 @@ def install_python_dev_dependencies(bench_path=".", apps=None, verbose=False):
|
|||||||
dev_requirements_path = os.path.join(app_path, "dev-requirements.txt")
|
dev_requirements_path = os.path.join(app_path, "dev-requirements.txt")
|
||||||
|
|
||||||
if os.path.exists(pyproject_path):
|
if os.path.exists(pyproject_path):
|
||||||
pyproject_deps = _generate_dev_deps_pattern(pyproject_path)
|
try:
|
||||||
if pyproject_deps:
|
from tomli import loads
|
||||||
|
except ImportError:
|
||||||
|
from tomllib import loads
|
||||||
|
|
||||||
|
pyroject_config = loads(open(pyproject_path).read())
|
||||||
|
for key, deps in pyroject_config["project"]["optional-dependencies"].items():
|
||||||
|
bench.run(f"{bench.python} -m pip install {quiet_flag} --upgrade {' '.join(deps)}")
|
||||||
|
if pyproject_deps := _generate_dev_deps_pattern(pyproject_path):
|
||||||
bench.run(f"{bench.python} -m pip install {quiet_flag} --upgrade {pyproject_deps}")
|
bench.run(f"{bench.python} -m pip install {quiet_flag} --upgrade {pyproject_deps}")
|
||||||
|
|
||||||
if not pyproject_deps and os.path.exists(dev_requirements_path):
|
if not pyproject_deps and os.path.exists(dev_requirements_path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user