Skip to content

Commit 1251ac2

Browse files
mdellwegdralley
authored andcommitted
Use uv
1 parent ce92be3 commit 1251ac2

22 files changed

Lines changed: 1892 additions & 292 deletions

.ci/scripts/calc_constraints.py

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

.ci/scripts/collect_changes.py

Lines changed: 1 addition & 1 deletion
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",

.ci/scripts/validate_commit_message.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
repo = g.get_repo("pulp/pulp-cli")
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:

.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/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: 4 additions & 4 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"
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

.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-*.whl pulp-glue/dist/pulp_glue-*.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

.github/workflows/pr.yml

Lines changed: 14 additions & 11 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
docs:
2323
needs:
@@ -33,24 +33,27 @@ jobs:
3333
check-commits:
3434
runs-on: "ubuntu-latest"
3535
steps:
36-
- uses: "actions/checkout@v6"
36+
- name: "Checkout"
37+
uses: "actions/checkout@v6"
3738
with:
3839
fetch-depth: 0
3940
- name: "Set up Python"
4041
uses: "actions/setup-python@v6"
4142
with:
42-
python-version: "3.x"
43-
- name: "Install python dependencies"
44-
run: |
45-
pip install toml pygithub
43+
python-version: "3.14"
44+
allow-prereleases: true
45+
- name: "Install uv"
46+
uses: "astral-sh/setup-uv@v7"
47+
with:
48+
enable-cache: true
4649
- name: "Check commit message"
4750
env:
4851
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4952
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
5053
run: |
5154
for SHA in $(curl -H "Authorization: token $GITHUB_TOKEN" "$GITHUB_CONTEXT" | jq -r '.[].sha')
5255
do
53-
python .ci/scripts/validate_commit_message.py "$SHA"
56+
uv run -q .ci/scripts/validate_commit_message.py "$SHA"
5457
VALUE=$?
5558
if [ "$VALUE" -gt 0 ]; then
5659
exit "$VALUE"

.github/workflows/pr_checks.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,25 @@ jobs:
1919
permissions:
2020
pull-requests: "write"
2121
steps:
22-
- uses: "actions/checkout@v6"
22+
- name: "Checkout"
23+
uses: "actions/checkout@v6"
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:
27-
python-version: "3.x"
29+
python-version: "3.14"
30+
allow-prereleases: true
31+
- name: "Install uv"
32+
uses: "astral-sh/setup-uv@v7"
33+
with:
34+
enable-cache: true
2835
- name: "Determine PR labels"
2936
run: |
30-
pip install GitPython==3.1.42
3137
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"
38+
uv run -q .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
39+
- name: "Apply PR Labels"
40+
uses: "actions/github-script@v8"
3541
with:
3642
script: |
3743
const { ADD_LABELS, REMOVE_LABELS } = process.env;

0 commit comments

Comments
 (0)