Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .ci/bootstrap_catdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ else
fi
echo "${COMMIT_MSG}"

pip install -r test_requirements.txt
uv pip install -r test_requirements.txt

./plugin-template --generate-config --plugin-app-label catdog pulp_catdog
mkdir -p ../pulp_catdog/.ci/assets/bindings
sed -i "s/test_s3: false/test_s3: true/g" ../pulp_catdog/template_config.yml
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: "Build"
on:
workflow_call:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "pulp_catdog"
Expand All @@ -20,6 +23,10 @@ jobs:
- uses: "actions/setup-python@v6"
with:
python-version: "3.11"
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
run: |
Expand All @@ -34,14 +41,14 @@ jobs:
path: "pulp-openapi-generator"
- name: "Install python dependencies"
run: |
pip install build packaging twine wheel mkdocs jq
uv pip install build packaging twine wheel mkdocs jq
- name: "Build package"
run: |
python3 -m build
twine check dist/*
- name: "Install built packages"
run: |
pip install dist/pulp_catdog-*-py3-none-any.whl -c .ci/assets/ci_constraints.txt
uv pip install dist/pulp_catdog-*-py3-none-any.whl -c .ci/assets/ci_constraints.txt
- name: "Generate api specs"
run: |
pulpcore-manager openapi --file "api.json"
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name: "Test bootstrapping a plugin"
on: {pull_request: {branches: ['*']}}

env:
UV_SYSTEM_PYTHON: "1"

concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true
Expand All @@ -21,6 +24,10 @@ jobs:
- uses: "actions/setup-python@v6"
with:
python-version: "3.11"
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
run: |
Expand All @@ -29,7 +36,7 @@ jobs:
# Below this line we include the steps of the ci workflow of the generated plugin
- name: "Install python dependencies"
run: |
pip install requests pygithub pyyaml
uv pip install requests pygithub pyyaml
- name: "Check commit message"
# This will fail for our fake plugin
if: false
Expand Down Expand Up @@ -92,7 +99,7 @@ jobs:
mkdir -p "pulp_catdog"
working-directory: "."
- name: "Download Deprecations"
uses: "actions/download-artifact@v8"
uses: "actions/download-artifact@v8"
with:
pattern: "deprecations-*"
path: "pulp_catdog"
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ name: "Lint"
on:
workflow_call:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "pulp_catdog"
Expand All @@ -27,10 +30,14 @@ jobs:
- uses: "actions/setup-python@v6"
with:
python-version: "3.11"
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Lint plugin_template"
working-directory: "plugin_template"
run: |
pip3 install ruff
uv pip install ruff
ruff format --check --diff plugin-template utils.py
ruff check plugin-template utils.py
- name: "Bootstrap catdog plugin"
Expand All @@ -42,7 +49,7 @@ jobs:

- name: "Install python dependencies"
run: |
pip install -r lint_requirements.txt
uv pip install -r lint_requirements.txt

- name: "Lint workflow files"
run: |
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
- "main"
- "[0-9]+.[0-9]+"

env:
UV_SYSTEM_PYTHON: "1"

# This workflow runs with elevated permissions.
# Do not even think about running a single bit of code from the PR.
# Static analysis should be fine however.
Expand All @@ -38,9 +41,13 @@ jobs:
- uses: "actions/setup-python@v6"
with:
python-version: "3.11"
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Determine PR labels"
run: |
pip install GitPython==3.1.42
uv 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"
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ name: "Sanity"
on:
workflow_call:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "pulp_catdog"
Expand All @@ -32,6 +35,11 @@ jobs:
with:
python-version: "3.11"

- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true

- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
run: |
Expand All @@ -40,7 +48,7 @@ jobs:
# Below this line we include the steps of the ci workflow of the generated plugin
- name: "Install python dependencies"
run: |
pip install -r lint_requirements.txt
uv pip install -r lint_requirements.txt

- name: "Verify bump version config"
run: |
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
required: true
type: "string"

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "pulp_catdog"
Expand All @@ -37,6 +40,11 @@ jobs:
with:
python-version: "3.11"

- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true

- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
run: |
Expand Down Expand Up @@ -78,7 +86,7 @@ jobs:

- name: "Install python dependencies"
run: |
pip install build towncrier twine wheel httpie docker netaddr boto3 'ansible~=10.3.0' mkdocs jq jsonpatch bump-my-version
uv pip install build towncrier twine wheel httpie docker netaddr boto3 'ansible~=10.3.0' mkdocs jq jsonpatch bump-my-version
echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/pulp_catdog/.ci/assets/httpie/" >> $GITHUB_ENV

- name: "Set environment variables"
Expand Down Expand Up @@ -148,5 +156,5 @@ jobs:
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp bash -c "pip3 list" || true
docker exec pulp bash -c "uv pip list" || true
...
2 changes: 1 addition & 1 deletion templates/github/.ci/ansible/Containerfile.j2.copy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ADD ./{{ plugin_name }}/{{ plugin_name | replace("-", "_") }}/app/webserver_snip
ADD ./{{ item.origin }} {{ item.destination }}
{%- endfor %}

# This MUST be the ONLY call to pip install in inside the container.
# This MUST be the ONLY package install inside the container.
RUN --mount=type=cache,target=/root/.cache/uv uv pip install --upgrade setuptools wheel && \
uv pip install {{ image.source }}
{%- if image.upperbounds | default(false) -%}
Expand Down
5 changes: 4 additions & 1 deletion templates/github/.github/workflows/build.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ name: "Build"
on:
workflow_call:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "{{ plugin_name }}"
Expand All @@ -35,7 +38,7 @@ jobs:
twine check dist/*
- name: "Install built packages"
run: |
pip install dist/{{ plugin_name | snake }}-*-py3-none-any.whl -c .ci/assets/ci_constraints.txt
uv pip install dist/{{ plugin_name | snake }}-*-py3-none-any.whl -c .ci/assets/ci_constraints.txt
- name: "Generate api specs"
run: |
pulpcore-manager openapi --file "api.json"
Expand Down
5 changes: 4 additions & 1 deletion templates/github/.github/workflows/ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ with context %}
name: "{{ plugin_app_label | camel }} CI"
on: {{ ci_trigger | default("{pull_request: {branches: ['*']}}") }}

env:
UV_SYSTEM_PYTHON: "1"

concurrency:
group: {{ '${{ github.ref_name }}-${{ github.workflow }}' }}
cancel-in-progress: true
Expand Down Expand Up @@ -115,7 +118,7 @@ jobs:
mkdir -p "{{ plugin_name }}"
working-directory: "."
- name: "Download Deprecations"
uses: "actions/download-artifact@v8"
uses: "actions/download-artifact@v8"
with:
pattern: "deprecations-*"
path: "{{ plugin_name }}"
Expand Down
1 change: 1 addition & 0 deletions templates/github/.github/workflows/create-branch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

env:
RELEASE_WORKFLOW: true
UV_SYSTEM_PYTHON: "1"

jobs:
create-branch:
Expand Down
3 changes: 3 additions & 0 deletions templates/github/.github/workflows/docs.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
required: true
type: "string"

env:
UV_SYSTEM_PYTHON: "1"

jobs:
changelog:
runs-on: "ubuntu-latest"
Expand Down
3 changes: 3 additions & 0 deletions templates/github/.github/workflows/lint.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ name: "Lint"
on:
workflow_call:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "{{ plugin_name }}"
Expand Down
3 changes: 3 additions & 0 deletions templates/github/.github/workflows/nightly.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
- cron: "00 3 * * *"
workflow_dispatch:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "{{ plugin_name }}"
Expand Down
5 changes: 4 additions & 1 deletion templates/github/.github/workflows/pr_checks.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
- "{{ plugin_default_branch }}"
- "[0-9]+.[0-9]+"

env:
UV_SYSTEM_PYTHON: "1"

# This workflow runs with elevated permissions.
# Do not even think about running a single bit of code from the PR.
# Static analysis should be fine however.
Expand All @@ -37,7 +40,7 @@ jobs:
- name: "Determine PR labels"
run: |
{%- raw %}
pip install GitPython==3.1.42
uv 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"
{%- endraw %}
Expand Down
5 changes: 4 additions & 1 deletion templates/github/.github/workflows/publish.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "{{ plugin_name }}"
Expand Down Expand Up @@ -148,7 +151,7 @@ jobs:

- name: "Install towncrier"
run: |
pip install towncrier
uv pip install towncrier

- name: "Get release notes"
id: "get_release_notes"
Expand Down
3 changes: 3 additions & 0 deletions templates/github/.github/workflows/release.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ name: {{ plugin_app_label | camel }} Release Pipeline
on:
workflow_dispatch:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "{{ plugin_name }}"
Expand Down
3 changes: 3 additions & 0 deletions templates/github/.github/workflows/sanity.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ name: "Sanity"
on:
workflow_call:

env:
UV_SYSTEM_PYTHON: "1"

defaults:
run:
working-directory: "{{ plugin_name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ echo "# Constraints Files:"
tail -v -n +1 ../*/*constraints.txt || true

echo
echo "# pip list outside the container"
pip list
echo "# package list outside the container"
uv pip list

echo
echo "# pip list inside the container"
cmd_prefix bash -c "pip3 list"
echo "# package list inside the container"
cmd_prefix bash -c "uv pip list"

echo
echo "# State of the containers"
Expand Down
6 changes: 3 additions & 3 deletions templates/github/.github/workflows/scripts/install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ source .github/workflows/scripts/utils.sh

PIP_REQUIREMENTS=("{{ cli_package }}" "yq")

# This must be the **only** call to "pip install" on the test runner.
pip install ${PIP_REQUIREMENTS[*]}
# This must be the **only** package install on the test runner.
uv pip install ${PIP_REQUIREMENTS[*]}

if [[ "$TEST" = "s3" ]]; then
for i in {1..3}
Expand All @@ -29,7 +29,7 @@ fi
{%- if test_cli %}

# Check out the {{ cli_package }} branch matching the installed version.
PULP_CLI_VERSION="$(pip freeze | sed -n -e 's/{{ cli_package }}==//p')"
PULP_CLI_VERSION="$(uv pip freeze | sed -n -e 's/{{ cli_package }}==//p')"
git clone --depth 1 --branch "$PULP_CLI_VERSION" {{ cli_repo }} ../{{ cli_package }}
{%- endif %}

Expand Down
Loading