mirror of
https://github.com/frappe/bench.git
synced 2025-01-06 23:44:03 +00:00
fix: use with
to read pyproject.toml
Also fix variable name Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
af8ed34201
commit
f3110e5456
@ -114,10 +114,11 @@ def _generate_dev_deps_pattern(pyproject_path):
|
||||
from tomllib import loads
|
||||
|
||||
requirements_pattern = ""
|
||||
pyroject_config = loads(open(pyproject_path).read())
|
||||
with open(pyproject_path) as f:
|
||||
pyproject_config = loads(f.read())
|
||||
|
||||
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 ""
|
||||
requirements_pattern += f"{pkg}{op}{version} "
|
||||
return requirements_pattern
|
||||
|
Loading…
Reference in New Issue
Block a user