File tree Expand file tree Collapse file tree 5 files changed +45
-6
lines changed
{{ cookiecutter.__project_name }} Expand file tree Collapse file tree 5 files changed +45
-6
lines changed Original file line number Diff line number Diff line change 11#!/bin/env python3
22
3- import sys
4-
53import click
64from packaging .version import parse
75
86if parse (click .__version__ ) < parse ("8.1.1" ) or parse (click .__version__ ) >= parse ("8.2" ):
97 print ("🚧 Linting with mypy is currently only supported with click~=8.1.1. 🚧" )
108 print ("🔧 Please run `pip install click~=8.1.1` first. 🔨" )
11- sys . exit (1 )
9+ exit (1 )
Original file line number Diff line number Diff line change 3030 "pulp-glue{{ cookiecutter.__app_label_suffix }}" ,
3131 "CHANGES/pulp-glue{{ cookiecutter.__app_label_suffix }}" ,
3232 {% - endif % }
33+ {% if not cookiecutter .app_label - % }
34+ ".ci/scripts/check_cli_dependencies.py" ,
35+ {% - endif % }
3336]
3437
3538for path in REMOVE_PATHS :
Original file line number Diff line number Diff line change 1+ #!/bin/env python3
2+
3+ import tomllib
4+ from pathlib import Path
5+
6+ from packaging .requirements import Requirement
7+
8+ if __name__ == "__main__" :
9+ base_path = Path (__file__ ).parent .parent .parent
10+ glue_path = "pulp-glue{{ cookiecutter.__app_label_suffix }}"
11+ with (base_path / "pyproject.toml" ).open ("rb" ) as fp :
12+ cli_pyproject = tomllib .load (fp )
13+
14+ cli_dependency = next (
15+ (
16+ Requirement (r )
17+ for r in cli_pyproject ["project" ]["dependencies" ]
18+ if r .startswith ("pulp-cli" )
19+ )
20+ )
21+
22+ with (base_path / glue_path / "pyproject.toml" ).open ("rb" ) as fp :
23+ glue_pyproject = tomllib .load (fp )
24+
25+ glue_dependency = next (
26+ (
27+ Requirement (r )
28+ for r in glue_pyproject ["project" ]["dependencies" ]
29+ if r .startswith ("pulp-glue" )
30+ )
31+ )
32+
33+ if cli_dependency .specifier != glue_dependency .specifier :
34+ print ("🪢 CLI and GLUE dependencies mismatch:" )
35+ print (" " , cli_dependency )
36+ print (" " , glue_dependency )
37+ exit (1 )
Original file line number Diff line number Diff line change 11#!/bin/env python3
22
3- import sys
4-
53import click
64from packaging .version import parse
75
86if parse (click .__version__ ) < parse ("8.1.1" ) or parse (click .__version__ ) >= parse ("8.2" ):
97 print ("🚧 Linting with mypy is currently only supported with click~=8.1.1. 🚧" )
108 print ("🔧 Please run `pip install click~=8.1.1` first. 🔨" )
11- sys . exit (1 )
9+ exit (1 )
Original file line number Diff line number Diff line change 3737{%- endif %}
3838 black --diff --check .
3939 flake8
40+ {%- if cookiecutter.glue and cookiecutter.app_label %}
41+ .ci/scripts/check_cli_dependencies.py
42+ {%- endif %}
4043 .ci/scripts/check_click_for_mypy.py
4144{%- if cookiecutter.glue %}
4245 MYPYPATH=pulp-glue{{ cookiecutter.__app_label_suffix }} mypy
You can’t perform that action at this time.
0 commit comments