diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8a6005a51..ec4f4bfb0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: matrix: python: - "3.11" - - "3.12" + - "3.13" steps: - uses: "actions/checkout@v4" - uses: "actions/cache@v4" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3543d41ed..87ef298b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ env: jobs: unittest: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" steps: - uses: "actions/checkout@v4" - uses: "actions/cache@v4" @@ -37,7 +37,7 @@ jobs: run: | make unittest test: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" needs: - "unittest" strategy: diff --git a/cookiecutter/ci/hooks/post_gen_project.py b/cookiecutter/ci/hooks/post_gen_project.py index d2f699850..cef61f3e1 100644 --- a/cookiecutter/ci/hooks/post_gen_project.py +++ b/cookiecutter/ci/hooks/post_gen_project.py @@ -30,7 +30,7 @@ "pulp-glue{{ cookiecutter.__app_label_suffix }}", "CHANGES/pulp-glue{{ cookiecutter.__app_label_suffix }}", {%- endif %} - {% if not cookiecutter.app_label -%} + {% if not cookiecutter.app_label or not cookiecutter.glue -%} ".ci/scripts/check_cli_dependencies.py", {%- endif %} ] diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/scripts/check_cli_dependencies.py b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/scripts/check_cli_dependencies.py index c88203405..64a8235ef 100755 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/scripts/check_cli_dependencies.py +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/scripts/check_cli_dependencies.py @@ -1,34 +1,28 @@ #!/bin/env python3 +import typing as t import tomllib from pathlib import Path from packaging.requirements import Requirement + +GLUE_DIR = "pulp-glue{{ cookiecutter.__app_label_suffix }}" + + +def dependencies(path: Path) -> t.Iterator[Requirement]: + with (path / "pyproject.toml").open("rb") as fp: + pyproject = tomllib.load(fp) + + return (Requirement(r) for r in pyproject["project"]["dependencies"]) + + if __name__ == "__main__": base_path = Path(__file__).parent.parent.parent - glue_path = "pulp-glue{{ cookiecutter.__app_label_suffix }}" - with (base_path / "pyproject.toml").open("rb") as fp: - cli_pyproject = tomllib.load(fp) - - cli_dependency = next( - ( - Requirement(r) - for r in cli_pyproject["project"]["dependencies"] - if r.startswith("pulp-cli") - ) - ) - - with (base_path / glue_path / "pyproject.toml").open("rb") as fp: - glue_pyproject = tomllib.load(fp) - - glue_dependency = next( - ( - Requirement(r) - for r in glue_pyproject["project"]["dependencies"] - if r.startswith("pulp-glue") - ) - ) + glue_path = base_path / GLUE_DIR + + cli_dependency = next((r for r in dependencies(base_path) if r.name == "pulp-cli")) + glue_dependency = next((r for r in dependencies(glue_path) if r.name == "pulp-glue")) if cli_dependency.specifier != glue_dependency.specifier: print("🪢 CLI and GLUE dependencies mismatch:") diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml index 698710d9f..5103b7e79 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: matrix: python: - "3.11" - - "3.12" + - "3.13" steps: - uses: "actions/checkout@v4" {%- include "cache_action" %} diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml index 2904ae171..355b9ac9b 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml @@ -13,7 +13,7 @@ env: jobs: {%- if cookiecutter.unittests %} unittest: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" steps: - uses: "actions/checkout@v4" {%- include "cache_action" %} @@ -33,7 +33,7 @@ jobs: make unittest {%- endif %} test: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" {%- if cookiecutter.unittests %} needs: - "unittest" diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/lint_requirements.txt b/cookiecutter/ci/{{ cookiecutter.__project_name }}/lint_requirements.txt index 89de0abfb..f2a2eef9d 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/lint_requirements.txt +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/lint_requirements.txt @@ -1,6 +1,6 @@ # Lint requirements black==25.1.0 -flake8==7.1.2 +flake8==7.2.0 flake8-pyproject==1.2.3 isort==6.0.1 mypy==1.15.0 diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update index c93c51cf8..dab691e6e 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update @@ -166,7 +166,7 @@ exclude = "cookiecutter" # This section is managed by the cookiecutter templates. profile = "black" line_length = 100 -skip = ["pulp-glue{{ cookiecutter.__app_label_suffix }}"{% if cookiecutter.app_label == "" %}, "cookiecutter"{% endif %}] +extend_skip = ["pulp-glue{{ cookiecutter.__app_label_suffix }}"{% if cookiecutter.app_label == "" %}, "cookiecutter"{% endif %}] [tool.flake8] # This section is managed by the cookiecutter templates.