-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DX: highlight
.constraints/py*.txt
as pip requirements (#364)
- Loading branch information
Showing
3 changed files
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from pathlib import Path # noqa: D100 | ||
|
||
from compwa_policy.utilities import CONFIG_PATH | ||
from compwa_policy.utilities.pyproject import Pyproject, get_constraints_file | ||
|
||
|
||
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] | ||
return any(path.exists() for path in constraint_paths) |