Skip to content

Commit

Permalink
FIX: allow projects without pyproject.toml (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Apr 5, 2024
1 parent e53735f commit a06d363
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compwa_policy/check_dev_files/precommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ruamel.yaml.scalarstring import DoubleQuotedScalarString

from compwa_policy.errors import PrecommitError
from compwa_policy.utilities import CONFIG_PATH
from compwa_policy.utilities.executor import Executor
from compwa_policy.utilities.precommit.getters import find_repo
from compwa_policy.utilities.pyproject import Pyproject, get_constraints_file
Expand Down Expand Up @@ -84,6 +85,8 @@ def _update_precommit_ci_commit_msg(precommit: ModifiablePrecommit) -> None:


def __has_constraint_files() -> bool:
if not CONFIG_PATH.pip_constraints.exists():
return False
python_versions = Pyproject.load().get_supported_python_versions()
constraint_files = [get_constraints_file(v) for v in python_versions]
constraint_paths = [Path(path) for path in constraint_files if path is not None]
Expand Down

0 comments on commit a06d363

Please sign in to comment.