Skip to content

Commit 58a5831

Browse files
committed
Update CI files
1 parent d5c7ee6 commit 58a5831

14 files changed

Lines changed: 43 additions & 65 deletions

.ci/assets/ci_constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pulpcore versions without the openapi command do no longer work in the CI
22
# Pulpcore versions without the django 5 storage compatibility will fail, >3.63,<3.70
3-
pulpcore>=3.21.30,!=3.23.*,!=3.24.*,!=3.25.*,!=3.26.*,!=3.27.*,!=3.29.*,!=3.30.*,!=3.31.*,!=3.32.*,!=3.33.*,!=3.34.*,!=3.35.*,!=3.36.*,!=3.37.*,!=3.38.*,!=3.40.*,!=3.41.*,!=3.42.*,!=3.43.*,!=3.44.*,!=3.45.*,!=3.46.*,!=3.47.*,!=3.48.*,!=3.50.*,!=3.51.*,!=3.52.*,!=3.53.*,!=3.54.*,!=3.64.*,!=3.65.*,!=3.66.*,!=3.67.*,!=3.68.*,!=3.69.*
3+
pulpcore>=3.49.0,!=3.50.*,!=3.51.*,!=3.52.*,!=3.53.*,!=3.54.*,!=3.64.*,!=3.65.*,!=3.66.*,!=3.67.*,!=3.68.*,!=3.69.*
44

55

66
tablib!=3.6.0

.ci/scripts/skip_tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.12"
4+
# dependencies = [
5+
# "gitpython>=3.1.62",
6+
# ]
7+
# ///
28
"""
39
skip_tests.py - Check if only documentation files were changed in a git branch
410

.ci/scripts/validate_commit_message.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# This file is managed by the plugin template.
22
# Do not edit.
33

4+
# /// script
5+
# requires-python = ">=3.12"
6+
# dependencies = [
7+
# "pygithub",
8+
# "pyyaml",
9+
# ]
10+
# ///
11+
412
import os
513
import re
614
import subprocess

.github/workflows/build.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@ jobs:
3838
uses: "astral-sh/setup-uv@v7"
3939
with:
4040
enable-cache: true
41-
- name: "Install python dependencies"
42-
run: |
43-
uv pip install build packaging twine wheel mkdocs jq
4441
- name: "Build package"
4542
run: |
46-
python3 -m build
47-
twine check dist/*
43+
uv build
44+
uvx twine check dist/*
4845
- name: "Install built packages"
4946
run: |
47+
# This seems to be the only way to inject the constraints file.
5048
uv pip install dist/pulp_python-*-py3-none-any.whl -c .ci/assets/ci_constraints.txt
5149
- name: "Generate api specs"
5250
run: |
@@ -88,15 +86,6 @@ jobs:
8886
if-no-files-found: "error"
8987
retention-days: 5
9088
overwrite: true
91-
- name: "Upload python client docs"
92-
uses: "actions/upload-artifact@v7"
93-
with:
94-
name: "python-client-docs.tar"
95-
path: |
96-
pulp_python/python-python-client-docs.tar
97-
if-no-files-found: "error"
98-
retention-days: 5
99-
overwrite: true
10089
- name: "Build Ruby bindings packages"
10190
run: |
10291
.github/workflows/scripts/build_ruby_client.sh

.github/workflows/ci.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,12 @@ jobs:
3030
path: "pulp_python"
3131
- uses: "actions/setup-python@v6"
3232
with:
33-
python-version: "3.11"
33+
python-version: "3.12"
3434
- name: "Install uv"
3535
uses: "astral-sh/setup-uv@v7"
3636
with:
3737
enable-cache: true
38-
- name: "Install python dependencies"
39-
run: |
40-
uv pip install requests pygithub pyyaml
4138
- name: "Check commit message"
42-
if: github.event_name == 'pull_request'
4339
env:
4440
PY_COLORS: "1"
4541
ANSIBLE_FORCE_COLOR: "1"
@@ -61,16 +57,12 @@ jobs:
6157

6258
- uses: "actions/setup-python@v6"
6359
with:
64-
python-version: "3.11"
60+
python-version: "3.12"
6561
- name: "Install uv"
6662
uses: "astral-sh/setup-uv@v7"
6763
with:
6864
enable-cache: true
6965

70-
- name: "Install python dependencies"
71-
run: |
72-
uv pip install gitpython
73-
7466
- name: "Analyze changed files"
7567
id: "check"
7668
shell: "bash"
@@ -86,7 +78,7 @@ jobs:
8678
BASE_REF=${{ github.event.pull_request.base.sha }}
8779
echo "Checking against:"
8880
git name-rev $BASE_REF
89-
python3 .ci/scripts/skip_tests.py . $BASE_REF
81+
uv run --script .ci/scripts/skip_tests.py . $BASE_REF
9082
exit_code=$?
9183
if [ $exit_code -ne 0 ] && [ $exit_code -ne 1 ]; then
9284
echo "Error: skip_tests.py returned unexpected exit code $exit_code"

.github/workflows/pr_checks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
enable-cache: true
4848
- name: "Determine PR labels"
4949
run: |
50-
uv pip install GitPython==3.1.42
5150
git fetch origin ${{ github.event.pull_request.head.sha }}
5251
uv run --script .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
5352
- uses: "actions/github-script@v8"

.github/workflows/sanity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- uses: "actions/setup-python@v6"
3434
with:
35-
python-version: "3.11"
35+
python-version: "3.12"
3636
- name: "Install uv"
3737
uses: "astral-sh/setup-uv@v7"
3838
with:

.github/workflows/scripts/before_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [ -f .github/workflows/scripts/pre_before_install.sh ]; then
2323
source .github/workflows/scripts/pre_before_install.sh
2424
fi
2525

26-
COMPONENT_VERSION="$(bump-my-version show current_version | tail -n -1 | python -c 'from packaging.version import Version; print(Version(input()))')"
26+
COMPONENT_VERSION="$(python -c 'import tomllib; from packaging.version import Version; print(Version(tomllib.load(open("pyproject.toml", "rb"))["tool"]["bumpversion"]["current_version"]))')"
2727
COMPONENT_SOURCE="./pulp_python/dist/pulp_python-${COMPONENT_VERSION}-py3-none-any.whl"
2828
if [ "$TEST" = "s3" ]; then
2929
COMPONENT_SOURCE="${COMPONENT_SOURCE} pulpcore[s3]"
Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# This script expects all <app_label>-api.json files to exist in the plugins root directory.
4-
# It produces a <app_label>-python-client.tar and <app_label>-python-client-docs.tar file in the plugins root directory.
4+
# It produces a <app_label>-python-client.tar file in the plugins root directory.
55

66
# WARNING: DO NOT EDIT!
77
#
@@ -21,34 +21,11 @@ rm -rf "pulp_python-client"
2121
./gen-client.sh "../pulp_python/python-api.json" "python" python "pulp_python"
2222

2323
pushd pulp_python-client
24-
python -m build
25-
26-
twine check "dist/pulp_python_client-"*"-py3-none-any.whl"
27-
twine check "dist/pulp_python_client-"*".tar.gz"
2824

25+
uv build
26+
uvx twine check "dist/pulp_python_client-"*"-py3-none-any.whl"
27+
uvx twine check "dist/pulp_python_client-"*".tar.gz"
2928
tar cvf "../../pulp_python/python-python-client.tar" ./dist
3029

31-
find ./docs/* -exec sed -i 's/Back to README/Back to HOME/g' {} \;
32-
find ./docs/* -exec sed -i 's/README//g' {} \;
33-
cp README.md docs/index.md
34-
sed -i 's/docs\///g' docs/index.md
35-
find ./docs/* -exec sed -i 's/\.md//g' {} \;
36-
37-
cat >> mkdocs.yml << DOCSYAML
38-
---
39-
site_name: PulpPython Client
40-
site_description: Python bindings
41-
site_author: Pulp Team
42-
site_url: https://docs.pulpproject.org/pulp_python_client/
43-
repo_name: pulp/pulp_python
44-
repo_url: https://github.com/pulp/pulp_python
45-
theme: readthedocs
46-
DOCSYAML
47-
48-
# Building the bindings docs
49-
mkdocs build
50-
51-
# Pack the built site.
52-
tar cvf ../../pulp_python/python-python-client-docs.tar ./site
5330
popd
5431
popd

.github/workflows/scripts/check_commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ set -euv
1414

1515
for SHA in $(curl -H "Authorization: token $GITHUB_TOKEN" "$GITHUB_CONTEXT" | jq -r '.[].sha')
1616
do
17-
python3 .ci/scripts/validate_commit_message.py "$SHA"
17+
uv run --script .ci/scripts/validate_commit_message.py "$SHA"
1818
done

0 commit comments

Comments
 (0)