Skip to content

Commit e700448

Browse files
committed
Use uv
1 parent ecab532 commit e700448

20 files changed

+1672
-140
lines changed

.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@v5"
12-
- uses: "actions/cache@v4"
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@v5"
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@v4"
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@v5"
2222
- name: "Initialize CodeQL"
2323
uses: "github/codeql-action/init@v3"

.github/workflows/collect_changes.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ jobs:
1212
with:
1313
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
1820
- name: "Setup git"
1921
run: |
2022
git config user.name pulpbot

.github/workflows/cookiecutter.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@ jobs:
2121
with:
2222
token: "${{ secrets.RELEASE_TOKEN }}"
2323
path: "pulp-cli"
24-
- name: "Set up Python"
25-
uses: "actions/setup-python@v6"
26-
with:
27-
python-version: "3.x"
2824
- name: "Setup git"
2925
run: |
3026
git config user.name pulpbot
3127
git config user.email pulp-infra@redhat.com
32-
- name: "Install python dependencies"
33-
run: |
34-
pip install cookiecutter tomlkit
28+
- name: "Set up Python"
29+
uses: "actions/setup-python@v6"
30+
with:
31+
python-version: "3.14"
32+
allow-prereleases: true
33+
- name: "Install uv"
34+
uses: "astral-sh/setup-uv@v7"
35+
with:
36+
enable-cache: true
3537
- name: "Apply cookiecutter templates"
3638
run: |
37-
../pulp-cli/cookiecutter/apply_templates.py
39+
uv run ../pulp-cli/cookiecutter/apply_templates.py
3840
if [ "$(git status --porcelain)" ]
3941
then
4042
git add .

.github/workflows/lint.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,18 @@ jobs:
1414
- "3.11"
1515
- "3.14"
1616
steps:
17-
- uses: "actions/checkout@v5"
18-
- uses: "actions/cache@v4"
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@v5"
27-
with:
28-
name: "pulp_cli_packages"
17+
- name: "Checkout"
18+
uses: "actions/checkout@v5"
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: |
38-
make lint
30+
make uv-lint
3931
...

.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@v5"
36+
- name: "Checkout"
37+
uses: "actions/checkout@v5"
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@v5"
22+
- name: "Checkout"
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:
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;

.github/workflows/publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ jobs:
1414
needs: "build"
1515
runs-on: "ubuntu-latest"
1616
steps:
17-
- uses: "actions/checkout@v5"
17+
- name: "Checkout"
18+
uses: "actions/checkout@v5"
1819
- name: "Download wheels"
1920
uses: "actions/download-artifact@v5"
2021
with:
2122
name: "pulp_cli_packages"
2223
- name: "Set up Python"
2324
uses: "actions/setup-python@v6"
2425
with:
25-
python-version: "3.x"
26+
python-version: "3.14"
27+
allow-prereleases: true
28+
- name: "Install uv"
29+
uses: "astral-sh/setup-uv@v7"
30+
with:
31+
enable-cache: true
2632
- name: "Install dependencies"
2733
run: |
2834
python -m pip install --upgrade pip

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
- name: "Set up Python"
1616
uses: "actions/setup-python@v6"
1717
with:
18-
python-version: "3.x"
18+
python-version: "3.14"
19+
allow-prereleases: true
1920
- name: "Install dependencies"
2021
run: |
2122
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)