Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ jobs:
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-cli"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.x"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Install python dependencies"
run: |
pip install cookiecutter tomlkit
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.14"
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Apply cookiecutter templates"
run: |
../pulp-cli/cookiecutter/apply_templates.py
uv run ../pulp-cli/cookiecutter/apply_templates.py
if [ "$(git status --porcelain)" ]
then
git add .
Expand Down
38 changes: 38 additions & 0 deletions cookiecutter/ci/templates/macros
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{%- macro concurrency() -%}
concurrency:
{%- raw %}
group: "main-${{ github.ref_name }}-${{ github.workflow }}"
{%- endraw %}
cancel-in-progress: true
{%- endmacro -%}

{%- macro checkout(deep=false) -%}
- name: "Checkout"
uses: "actions/checkout@v6"
{%- if deep %}
with:
fetch-depth: 0
{%- endif %}
{%- endmacro -%}

{%- macro download_wheels() -%}
- name: "Download wheels"
uses: "actions/download-artifact@v8"
with:
name: "pulp_cli_packages"
{%- endmacro -%}

{%- macro setup_python(version="3.14") -%}
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "{{ version }}"
allow-prereleases: true
{%- endmacro -%}

{%- macro install_uv() -%}
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
{%- endmacro -%}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{%- import 'macros' as macros with context -%}
---
name: "Update CI from cookiecutter"
on:
Expand All @@ -23,20 +24,15 @@ jobs:
token: "${{ secrets.RELEASE_TOKEN }}"
{%- endraw %}
path: "pulp-cli{{ cookiecutter.__app_label_suffix }}"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.x"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Install python dependencies"
run: |
pip install cookiecutter tomlkit
{{ macros.setup_python() | indent(6) }}
{{ macros.install_uv() | indent(6) }}
- name: "Apply cookiecutter templates"
run: |
../pulp-cli/cookiecutter/apply_templates.py
uv run ../pulp-cli/cookiecutter/apply_templates.py
if [ "$(git status --porcelain)" ]
then
git add .
Expand Down Expand Up @@ -77,20 +73,15 @@ jobs:
token: "${{ secrets.RELEASE_TOKEN }}"
{%- endraw %}
path: "pulp-cli{{ cookiecutter.__app_label_suffix }}"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.x"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Install python dependencies"
run: |
pip install packaging tomlkit
{{ macros.setup_python() | indent(6) }}
{{ macros.install_uv() | indent(6) }}
- name: "Apply cookiecutter templates"
run: |
../pulp-cli/cookiecutter/update_pulp_cli.py
uv run ../pulp-cli/cookiecutter/update_pulp_cli.py
if [ "$(git status --porcelain)" ]
then
git add .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ files = "{% if cookiecutter.src_layout %}src{% else %}pulp_glue{% endif %}/**/*.
mypy_path = ["{% if cookiecutter.src_layout %}src{% else %}.{% endif %}"]
namespace_packages = true
explicit_package_bases = true
{%- if cookiecutter.__app_label_suffix == "" %}
plugins = ["pydantic.mypy"]
{%- endif %}

[[tool.mypy.overrides]]
# This section is managed by the cookiecutter templates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ files = "{% if cookiecutter.src_layout %}src{% else %}pulpcore{% endif %}/**/*.p
mypy_path = ["{% if cookiecutter.src_layout %}src{% else %}.{% endif %}"{% if cookiecutter.glue %}, "pulp-glue{{ cookiecutter.__app_label_suffix }}{% if cookiecutter.src_layout %}/src{% endif %}"{% endif %}]
namespace_packages = true
explicit_package_bases = true
{%- if cookiecutter.__app_label_suffix == "" %}
plugins = ["pydantic.mypy"]
{%- endif %}

[[tool.mypy.overrides]]
# This section is managed by the cookiecutter templates.
Expand Down
1 change: 1 addition & 0 deletions pulp-glue/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ files = "src/**/*.py, tests/**/*.py"
mypy_path = ["src"]
namespace_packages = true
explicit_package_bases = true
plugins = ["pydantic.mypy"]

[[tool.mypy.overrides]]
# This section is managed by the cookiecutter templates.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ files = "src/**/*.py, tests/*.py"
mypy_path = ["src", "pulp-glue/src"]
namespace_packages = true
explicit_package_bases = true
plugins = ["pydantic.mypy"]

[[tool.mypy.overrides]]
# This section is managed by the cookiecutter templates.
Expand Down
Loading