Skip to content
Merged

Use uv #1297

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
119 changes: 0 additions & 119 deletions .ci/scripts/calc_constraints.py

This file was deleted.

2 changes: 1 addition & 1 deletion .ci/scripts/collect_changes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/env python3
# /// script
# requires-python = ">=3.11"
# requires-python = ">=3.13"
# dependencies = [
# "gitpython>=3.1.46,<3.2.0",
# "packaging>=25.0,<25.1",
Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/validate_commit_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
repo = g.get_repo("pulp/pulp-cli")


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


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

if len(matches) < 1:
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,27 @@ jobs:
build:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v6"
- uses: "actions/cache@v5"
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}"
restore-keys: |
${{ runner.os }}-pip-

- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.14"
- name: "Install python dependencies"
run: |
pip install build setuptools wheel
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Build wheels"
run: |
make build
touch .root
- name: "Upload wheels"
uses: "actions/upload-artifact@v6"
with:
name: "pulp_cli_packages"
path: |
pulp-glue/dist/
.root
dist/
if-no-files-found: "error"
retention-days: 5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
security-events: "write"

steps:
- name: "Checkout repository"
- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Initialize CodeQL"
uses: "github/codeql-action/init@v4"
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/collect_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ jobs:
collect-changes:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v6"
- name: "Checkout"
uses: "actions/checkout@v6"
with:
ref: "main"
fetch-depth: 0
- uses: "actions/setup-python@v6"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.x"
python-version: "3.14"
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Collect changes"
run: |
pip install GitPython packaging
python3 .ci/scripts/collect_changes.py
uv run --script .ci/scripts/collect_changes.py
- name: "Create Pull Request"
uses: "peter-evans/create-pull-request@v8"
id: "create_pr"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-cli"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
Expand All @@ -34,6 +30,10 @@ jobs:
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Apply cookiecutter templates"
run: |
uv run ../pulp-cli/cookiecutter/apply_templates.py
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,17 @@ jobs:
- "3.11"
- "3.14"
steps:
- uses: "actions/checkout@v6"
- uses: "actions/cache@v5"
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}"
restore-keys: |
${{ runner.os }}-pip-

- name: "Download wheels"
uses: "actions/download-artifact@v8"
with:
name: "pulp_cli_packages"
- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "${{ matrix.python }}"
- name: "Install python dependencies"
run: |
pip install dist/pulp_cli-*.whl pulp-glue/dist/pulp_glue-*.whl -r lint_requirements.txt
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Lint code"
run: |
make lint
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ concurrency:
cancel-in-progress: true

jobs:
build:
uses: "./.github/workflows/build.yml"
lint:
needs:
- "build"
uses: "./.github/workflows/lint.yml"
test:
build:
needs:
- "lint"
uses: "./.github/workflows/build.yml"
test:
needs:
- "build"
uses: "./.github/workflows/test.yml"
docs:
needs:
Expand All @@ -33,24 +33,27 @@ jobs:
check-commits:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v6"
- name: "Checkout"
uses: "actions/checkout@v6"
with:
fetch-depth: 0
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.x"
- name: "Install python dependencies"
run: |
pip install toml pygithub
python-version: "3.14"
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Check commit message"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
run: |
for SHA in $(curl -H "Authorization: token $GITHUB_TOKEN" "$GITHUB_CONTEXT" | jq -r '.[].sha')
do
python .ci/scripts/validate_commit_message.py "$SHA"
uv run -q .ci/scripts/validate_commit_message.py "$SHA"
VALUE=$?
if [ "$VALUE" -gt 0 ]; then
exit "$VALUE"
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,25 @@ jobs:
permissions:
pull-requests: "write"
steps:
- uses: "actions/checkout@v6"
- name: "Checkout"
uses: "actions/checkout@v6"
with:
fetch-depth: 0
- uses: "actions/setup-python@v6"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.x"
python-version: "3.14"
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Determine PR labels"
run: |
pip install GitPython==3.1.42
git fetch origin ${{ github.event.pull_request.head.sha }}
python .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
- uses: "actions/github-script@v8"
name: "Apply PR Labels"
uv run -q .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
- name: "Apply PR Labels"
uses: "actions/github-script@v8"
with:
script: |
const { ADD_LABELS, REMOVE_LABELS } = process.env;
Expand Down
Loading
Loading