Skip to content

Commit f399e22

Browse files
committed
Update cookiecutter
1 parent 9611331 commit f399e22

20 files changed

Lines changed: 216 additions & 274 deletions

.ci/scripts/calc_constraints.py

Lines changed: 0 additions & 119 deletions
This file was deleted.

.ci/scripts/collect_changes.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/env python3
22
# /// script
3-
# requires-python = ">=3.11"
3+
# requires-python = ">=3.13"
44
# dependencies = [
55
# "gitpython>=3.1.46,<3.2.0",
66
# "packaging>=25.0,<25.1",
@@ -80,7 +80,7 @@ def main():
8080
branches.sort(key=lambda ref: parse_version(ref.remote_head), reverse=True)
8181
branches = [ref.name for ref in branches]
8282

83-
with open(CHANGELOG_FILE, "r") as f:
83+
with open(CHANGELOG_FILE) as f:
8484
main_changelog = f.read()
8585
preamble, main_changes = split_changelog(main_changelog)
8686
old_length = len(main_changes)
@@ -105,8 +105,7 @@ def main():
105105
print(f"{new_length - old_length} new versions have been added.")
106106
with open(CHANGELOG_FILE, "w") as fp:
107107
fp.write(preamble)
108-
for change in main_changes:
109-
fp.write(change[1])
108+
fp.writelines(change[1] for change in main_changes)
110109

111110
repo.git.commit("-m", "Update Changelog", CHANGELOG_FILE)
112111

.ci/scripts/validate_commit_message.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@
3333
if NOISSUE_MARKER in message:
3434
sys.exit("Do not add '[noissue]' in the commit message.")
3535

36-
if any((re.match(pattern, message) for pattern in BLOCKING_REGEX)):
36+
if any(re.match(pattern, message) for pattern in BLOCKING_REGEX):
3737
sys.exit("This PR is not ready for consumption.")
3838

3939
g = Github(os.environ.get("GITHUB_TOKEN"))
4040
repo = g.get_repo("pulp/pulp-cli-maven")
4141

4242

43-
def check_status(issue):
43+
def check_status(issue: str) -> None:
4444
gi = repo.get_issue(int(issue))
4545
if gi.pull_request:
4646
sys.exit(f"Error: issue #{issue} is a pull request.")
4747
if gi.closed_at:
4848
sys.exit(f"Error: issue #{issue} is closed.")
4949

5050

51-
def check_changelog(issue):
51+
def check_changelog(issue: str) -> None:
5252
matches = list(Path("CHANGES").rglob(f"{issue}.*"))
5353

5454
if len(matches) < 1:
@@ -58,7 +58,7 @@ def check_changelog(issue):
5858
sys.exit(f"Invalid extension for changelog entry '{match}'.")
5959

6060

61-
print("Checking commit message for {sha}.".format(sha=sha[0:7]))
61+
print(f"Checking commit message for {sha[0:7]}.")
6262

6363
# validate the issue attached to the commit
6464
issue_regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords=("|").join(KEYWORDS))
@@ -72,4 +72,4 @@ def check_changelog(issue):
7272
check_status(issue)
7373
check_changelog(issue)
7474

75-
print("Commit message for {sha} passed.".format(sha=sha[0:7]))
75+
print(f"Commit message for {sha[0:7]} passed.")

.github/workflows/build.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,27 @@ jobs:
88
build:
99
runs-on: "ubuntu-latest"
1010
steps:
11-
- uses: "actions/checkout@v6"
12-
- uses: "actions/cache@v5"
13-
with:
14-
path: "~/.cache/pip"
15-
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}"
16-
restore-keys: |
17-
${{ runner.os }}-pip-
18-
11+
- name: "Checkout"
12+
uses: "actions/checkout@v6"
1913
- name: "Set up Python"
2014
uses: "actions/setup-python@v6"
2115
with:
2216
python-version: "3.14"
23-
- name: "Install python dependencies"
24-
run: |
25-
pip install build setuptools wheel
17+
allow-prereleases: true
18+
- name: "Install uv"
19+
uses: "astral-sh/setup-uv@v7"
20+
with:
21+
enable-cache: true
2622
- name: "Build wheels"
2723
run: |
2824
make build
25+
touch .root
2926
- name: "Upload wheels"
3027
uses: "actions/upload-artifact@v6"
3128
with:
3229
name: "pulp_cli_packages"
3330
path: |
34-
pulp-glue-maven/dist/
31+
.root
3532
dist/
3633
if-no-files-found: "error"
3734
retention-days: 5

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
security-events: "write"
1818

1919
steps:
20-
- name: "Checkout repository"
20+
- name: "Checkout"
2121
uses: "actions/checkout@v6"
2222
- name: "Initialize CodeQL"
2323
uses: "github/codeql-action/init@v4"

.github/workflows/collect_changes.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,26 @@ jobs:
88
collect-changes:
99
runs-on: "ubuntu-latest"
1010
steps:
11-
- uses: "actions/checkout@v6"
11+
- name: "Checkout"
12+
uses: "actions/checkout@v6"
1213
with:
13-
ref: "main"
1414
fetch-depth: 0
15-
- uses: "actions/setup-python@v6"
15+
- name: "Set up Python"
16+
uses: "actions/setup-python@v6"
1617
with:
17-
python-version: "3.x"
18+
python-version: "3.14"
19+
allow-prereleases: true
20+
- name: "Install uv"
21+
uses: "astral-sh/setup-uv@v7"
22+
with:
23+
enable-cache: true
1824
- name: "Setup git"
1925
run: |
2026
git config user.name pulpbot
2127
git config user.email pulp-infra@redhat.com
2228
- name: "Collect changes"
2329
run: |
24-
pip install GitPython packaging
25-
python3 .ci/scripts/collect_changes.py
30+
uv run --script .ci/scripts/collect_changes.py
2631
- name: "Create Pull Request"
2732
uses: "peter-evans/create-pull-request@v8"
2833
id: "create_pr"

.github/workflows/cookiecutter.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ jobs:
2121
with:
2222
token: "${{ secrets.RELEASE_TOKEN }}"
2323
path: "pulp-cli-maven"
24-
- name: "Setup git"
25-
run: |
26-
git config user.name pulpbot
27-
git config user.email pulp-infra@redhat.com
2824
- name: "Set up Python"
2925
uses: "actions/setup-python@v6"
3026
with:
@@ -34,6 +30,10 @@ jobs:
3430
uses: "astral-sh/setup-uv@v7"
3531
with:
3632
enable-cache: true
33+
- name: "Setup git"
34+
run: |
35+
git config user.name pulpbot
36+
git config user.email pulp-infra@redhat.com
3737
- name: "Apply cookiecutter templates"
3838
run: |
3939
uv run ../pulp-cli/cookiecutter/apply_templates.py
@@ -70,10 +70,6 @@ jobs:
7070
with:
7171
token: "${{ secrets.RELEASE_TOKEN }}"
7272
path: "pulp-cli-maven"
73-
- name: "Setup git"
74-
run: |
75-
git config user.name pulpbot
76-
git config user.email pulp-infra@redhat.com
7773
- name: "Set up Python"
7874
uses: "actions/setup-python@v6"
7975
with:
@@ -83,6 +79,10 @@ jobs:
8379
uses: "astral-sh/setup-uv@v7"
8480
with:
8581
enable-cache: true
82+
- name: "Setup git"
83+
run: |
84+
git config user.name pulpbot
85+
git config user.email pulp-infra@redhat.com
8686
- name: "Apply cookiecutter templates"
8787
run: |
8888
uv run ../pulp-cli/cookiecutter/update_pulp_cli.py

.github/workflows/lint.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,17 @@ jobs:
1414
- "3.11"
1515
- "3.14"
1616
steps:
17-
- uses: "actions/checkout@v6"
18-
- uses: "actions/cache@v5"
19-
with:
20-
path: "~/.cache/pip"
21-
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}"
22-
restore-keys: |
23-
${{ runner.os }}-pip-
24-
25-
- name: "Download wheels"
26-
uses: "actions/download-artifact@v8"
27-
with:
28-
name: "pulp_cli_packages"
17+
- name: "Checkout"
18+
uses: "actions/checkout@v6"
2919
- name: "Set up Python"
3020
uses: "actions/setup-python@v6"
3121
with:
3222
python-version: "${{ matrix.python }}"
33-
- name: "Install python dependencies"
34-
run: |
35-
pip install dist/pulp_cli_maven-*.whl pulp-glue-maven/dist/pulp_glue_maven-*.whl -r lint_requirements.txt
23+
allow-prereleases: true
24+
- name: "Install uv"
25+
uses: "astral-sh/setup-uv@v7"
26+
with:
27+
enable-cache: true
3628
- name: "Lint code"
3729
run: |
3830
make lint

0 commit comments

Comments
 (0)