Skip to content

Commit 96fff8e

Browse files
committed
Update cookiecutter
1 parent 738155e commit 96fff8e

File tree

11 files changed

+82
-80
lines changed

11 files changed

+82
-80
lines changed

cookiecutter/ci/{{ cookiecutter.__project_name }}/.ci/scripts/validate_commit_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# /// script
22
# requires-python = ">=3.11"
33
# dependencies = [
4-
# "gitpython>=3.1.46,<3.2.0",
4+
# "pygithub>=2.8.1,<3.0.0",
55
# ]
66
# ///
77

cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@ jobs:
99
runs-on: "ubuntu-latest"
1010
steps:
1111
- uses: "actions/checkout@v5"
12-
{%- include "cache_action" %}
1312
- name: "Set up Python"
1413
uses: "actions/setup-python@v6"
1514
with:
1615
python-version: "3.14"
17-
- name: "Install python dependencies"
18-
run: |
19-
pip install build setuptools wheel
16+
- name: "Install uv"
17+
uses: "astral-sh/setup-uv@v7"
18+
with:
19+
enable-cache: true
2020
- name: "Build wheels"
2121
run: |
2222
make build
23+
touch .root
2324
- name: "Upload wheels"
2425
uses: "actions/upload-artifact@v4"
2526
with:
2627
name: "pulp_cli_packages"
2728
path: |
28-
pulp-glue{{ cookiecutter.__app_label_suffix }}/dist/
29+
.root
2930
dist/
3031
if-no-files-found: "error"
3132
retention-days: 5

cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/lint.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@ jobs:
1515
- "3.14"
1616
steps:
1717
- uses: "actions/checkout@v5"
18-
{%- include "cache_action" %}
19-
- name: "Download wheels"
20-
uses: "actions/download-artifact@v5"
21-
with:
22-
name: "pulp_cli_packages"
2318
- name: "Set up Python"
2419
uses: "actions/setup-python@v6"
2520
with:
2621
python-version: "{{ "${{ matrix.python }}" }}"
27-
- name: "Install python dependencies"
28-
run: |
29-
pip install dist/pulp_cli{{ cookiecutter.__app_label_suffix | replace ("-", "_") }}-*.whl {%- if cookiecutter.glue %} pulp-glue{{ cookiecutter.__app_label_suffix }}/dist/pulp_glue{{ cookiecutter.__app_label_suffix | replace ("-", "_") }}-*.whl {%- endif %} -r lint_requirements.txt
22+
- name: "Install uv"
23+
uses: "astral-sh/setup-uv@v7"
24+
with:
25+
enable-cache: true
3026
- name: "Lint code"
3127
run: |
32-
make lint
28+
make uv-lint
3329
...

cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ concurrency:
99
cancel-in-progress: true
1010

1111
jobs:
12-
build:
13-
uses: "./.github/workflows/build.yml"
1412
lint:
15-
needs:
16-
- "build"
1713
uses: "./.github/workflows/lint.yml"
18-
test:
14+
build:
1915
needs:
2016
- "lint"
17+
uses: "./.github/workflows/build.yml"
18+
test:
19+
needs:
20+
- "build"
2121
uses: "./.github/workflows/test.yml"
2222
{%- if cookiecutter.docs %}
2323
docs:
@@ -42,17 +42,18 @@ jobs:
4242
uses: "actions/setup-python@v6"
4343
with:
4444
python-version: "3.x"
45-
- name: "Install python dependencies"
46-
run: |
47-
pip install toml pygithub
45+
- name: "Install uv"
46+
uses: "astral-sh/setup-uv@v7"
47+
with:
48+
enable-cache: true
4849
- name: "Check commit message"
4950
env:
5051
GITHUB_TOKEN: "{{ "${{ secrets.GITHUB_TOKEN }}" }}"
5152
GITHUB_CONTEXT: "{{ "${{ github.event.pull_request.commits_url }}" }}"
5253
run: |
5354
for SHA in $(curl -H "Authorization: token $GITHUB_TOKEN" "$GITHUB_CONTEXT" | jq -r '.[].sha')
5455
do
55-
python .ci/scripts/validate_commit_message.py "$SHA"
56+
uv run -q .ci/scripts/validate_commit_message.py "$SHA"
5657
VALUE=$?
5758
if [ "$VALUE" -gt 0 ]; then
5859
exit "$VALUE"

cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/pr_checks.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,24 @@ jobs:
1919
permissions:
2020
pull-requests: "write"
2121
steps:
22-
- uses: "actions/checkout@v5"
22+
- name: "Fetch Repository"
23+
uses: "actions/checkout@v5"
2324
with:
2425
fetch-depth: 0
25-
- uses: "actions/setup-python@v6"
26+
- name: "Set up Python"
27+
uses: "actions/setup-python@v6"
2628
with:
2729
python-version: "3.x"
30+
- name: "Install uv"
31+
uses: "astral-sh/setup-uv@v7"
32+
with:
33+
enable-cache: true
2834
- name: "Determine PR labels"
2935
run: |
30-
pip install GitPython==3.1.42
3136
git fetch origin ${{ github.event.pull_request.head.sha }}
32-
python .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
33-
- uses: "actions/github-script@v8"
34-
name: "Apply PR Labels"
37+
uv run -q .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
38+
- name: "Apply PR Labels"
39+
uses: "actions/github-script@v8"
3540
with:
3641
script: |
3742
const { ADD_LABELS, REMOVE_LABELS } = process.env;

cookiecutter/ci/{{ cookiecutter.__project_name }}/.github/workflows/test.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
runs-on: "ubuntu-latest"
1717
steps:
1818
- uses: "actions/checkout@v5"
19-
{%- include "cache_action" %}
2019
- name: "Download wheels"
2120
uses: "actions/download-artifact@v5"
2221
with:
@@ -25,12 +24,13 @@ jobs:
2524
uses: "actions/setup-python@v6"
2625
with:
2726
python-version: "3.14"
28-
- name: "Install Python Test Dependencies"
29-
run: |
30-
pip install dist/pulp_cli{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- if cookiecutter.glue %} pulp-glue{{ cookiecutter.__app_label_suffix }}/dist/pulp_glue{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- endif %} -r test_requirements.txt
27+
- name: "Install uv"
28+
uses: "astral-sh/setup-uv@v7"
29+
with:
30+
enable-cache: true
3131
- name: "Run tests"
3232
run: |
33-
make unittest
33+
uv run --isolated --with dist/pulp_glue*.whl --with dist/pulp_cli*.whl --only-group test make unittest
3434
{%- endif %}
3535
test:
3636
runs-on: "ubuntu-24.04"
@@ -43,7 +43,6 @@ jobs:
4343
matrix:{{ cookiecutter.test_matrix | jaml(level=4, embed_in="dict") }}
4444
steps:
4545
- uses: "actions/checkout@v5"
46-
{%- include "cache_action" %}
4746
- name: "Download wheels"
4847
uses: "actions/download-artifact@v5"
4948
with:
@@ -60,18 +59,10 @@ jobs:
6059
run: |
6160
sudo apt-get install {{ cookiecutter.binary_dependencies }}
6261
{%- endif %}
63-
- name: "Install Python Test Dependencies"
64-
run: |
65-
if [ "{{ "${{matrix.lower_bounds}}" }}" ]
66-
then
67-
pip install dist/pulp_cli{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- if cookiecutter.glue %} pulp-glue{{ cookiecutter.__app_label_suffix }}/dist/pulp_glue{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- endif %} -r test_requirements.txt -c lower_bounds_constraints.lock
68-
elif [ "{{ "${{matrix.upper_bounds}}" }}" ]
69-
then
70-
.ci/scripts/calc_constraints.py pyproject.toml {%- if cookiecutter.glue %} pulp-glue{{ cookiecutter.__app_label_suffix }}/pyproject.toml {%- endif %} --upper > upper_bounds_constraints.lock
71-
pip install dist/pulp_cli{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- if cookiecutter.glue %} pulp-glue{{ cookiecutter.__app_label_suffix }}/dist/pulp_glue{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- endif %} -r test_requirements.txt -c upper_bounds_constraints.lock
72-
else
73-
pip install dist/pulp_cli{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- if cookiecutter.glue %} pulp-glue{{ cookiecutter.__app_label_suffix }}/dist/pulp_glue{{ cookiecutter.__app_label_suffix | replace("-", "_") }}-*.whl {%- endif %} -r test_requirements.txt
74-
fi
62+
- name: "Install uv"
63+
uses: "astral-sh/setup-uv@v7"
64+
with:
65+
enable-cache: true
7566
- name: "Run tests"
7667
env:
7768
{%- raw %}
@@ -87,5 +78,17 @@ jobs:
8778
OAS_VERSION: "${{ matrix.oas_version }}"
8879
{%- endraw %}
8980
run: |
90-
.ci/run_container.sh make {% if cookiecutter.unittests %}live{% endif %}test
81+
{%- raw %}
82+
if [ "${{matrix.lower_bounds}}" ]
83+
then
84+
RESOLUTION=("--resolution" "lowest-direct")
85+
elif [ "${{matrix.upper_bounds}}" ]
86+
then
87+
RESOLUTION=("--resolution" "highest")
88+
else
89+
RESOLUTION=()
90+
fi
91+
92+
uv run "${RESOLUTION[@]}" --isolated --with dist/pulp_glue*.whl --with dist/pulp_cli*.whl --only-group test .ci/run_container.sh make livetest
93+
{%- endraw %}
9194
...
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
*.egg-info
22
__pycache__/
33
build/
4-
tests/cli.toml
5-
pytest_pulp_cli/GPG-PRIVATE-KEY-fixture-signing
64
site/
75
dist/
86
*.po~
7+
8+
tests/cli.toml
9+
GPG-PRIVATE-KEY-fixture-signing
10+
.root

cookiecutter/ci/{{ cookiecutter.__project_name }}/Makefile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
LANGUAGES=de
33
{%- endif %}
44
{%- if cookiecutter.glue %}
5-
GLUE_PLUGINS=$(notdir $(wildcard pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/*))
5+
GLUE_PLUGINS=$(notdir $(wildcard pulp-glue{{ cookiecutter.__app_label_suffix }}/src/pulp_glue/*))
66
{%- endif %}
7-
CLI_PLUGINS=$(notdir $(wildcard pulpcore/cli/*))
7+
CLI_PLUGINS=$(notdir $(wildcard src/pulpcore/cli/*))
88

99
.PHONY: info
1010
info:
@@ -17,16 +17,18 @@ info:
1717

1818
.PHONY: build
1919
build:
20-
{%- if cookiecutter.glue %}
21-
cd pulp-glue{{ cookiecutter.__app_label_suffix }}; pyproject-build -n
22-
{%- endif %}
23-
pyproject-build -n
20+
uv build --all
2421

2522
.PHONY: format
2623
format:
2724
ruff format
2825
ruff check --fix
2926

27+
.PHONY: uv-format
28+
uv-format:
29+
uv lock
30+
uv run --isolated --group lint $(MAKE) format
31+
3032
.PHONY: lint
3133
lint:
3234
find tests .ci -name '*.sh' -print0 | xargs -0 shellcheck -x
@@ -36,14 +38,17 @@ lint:
3638
.ci/scripts/check_cli_dependencies.py
3739
{%- endif %}
3840
.ci/scripts/check_click_for_mypy.py
41+
mypy
3942
{%- if cookiecutter.glue %}
40-
MYPYPATH=pulp-glue{{ cookiecutter.__app_label_suffix }} mypy
4143
cd pulp-glue{{ cookiecutter.__app_label_suffix }}; mypy
42-
{%- else %}
43-
mypy
4444
{%- endif %}
4545
@echo "🙊 Code 🙈 LGTM 🙉 !"
4646

47+
.PHONY: uv-lint
48+
uv-lint:
49+
uv lock --check
50+
uv run --isolated --group lint $(MAKE) lint
51+
4752
tests/cli.toml:
4853
cp $@.example $@
4954
@echo "In order to configure the tests to talk to your test server, you might need to edit $@ ."

cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pyproject.toml.update

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[tool.setuptools.packages.find]
66
# This section is managed by the cookiecutter templates.
7-
where = ["."]
7+
where = ["src"]
88
include = ["pulp_glue.*"]
99
namespaces = true
1010

@@ -22,10 +22,11 @@ extend-select = ["I"]
2222

2323
[tool.mypy]
2424
# This section is managed by the cookiecutter templates.
25+
mypy_path = ["src"]
2526
strict = true
2627
warn_unused_ignores = false
2728
show_error_codes = true
28-
files = "pulp_glue/**/*.py, tests/**/*.py"
29+
files = "src/**/*.py, tests/**/*.py"
2930
namespace_packages = true
3031
explicit_package_bases = true
3132

cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.main_package }}/__init__.py renamed to cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/src/pulp_glue/{{ cookiecutter.main_package }}/__init__.py

File renamed without changes.

0 commit comments

Comments
 (0)