mirror of
https://github.com/frappe/bench.git
synced 2025-01-08 16:14:12 +00:00
Merge pull request #1597 from akhilnarang/fix-pyproject-open
fix: use `with` to read pyproject.toml
This commit is contained in:
commit
aae99fa10e
@ -114,10 +114,11 @@ def _generate_dev_deps_pattern(pyproject_path):
|
|||||||
from tomllib import loads
|
from tomllib import loads
|
||||||
|
|
||||||
requirements_pattern = ""
|
requirements_pattern = ""
|
||||||
pyroject_config = loads(open(pyproject_path).read())
|
with open(pyproject_path) as f:
|
||||||
|
pyproject_config = loads(f.read())
|
||||||
|
|
||||||
with contextlib.suppress(KeyError):
|
with contextlib.suppress(KeyError):
|
||||||
for pkg, version in pyroject_config["tool"]["bench"]["dev-dependencies"].items():
|
for pkg, version in pyproject_config["tool"]["bench"]["dev-dependencies"].items():
|
||||||
op = "==" if "=" not in version else ""
|
op = "==" if "=" not in version else ""
|
||||||
requirements_pattern += f"{pkg}{op}{version} "
|
requirements_pattern += f"{pkg}{op}{version} "
|
||||||
return requirements_pattern
|
return requirements_pattern
|
||||||
|
Loading…
Reference in New Issue
Block a user