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
67 changes: 67 additions & 0 deletions .github/actions/sync-uv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'Sync UV Action'
description: 'Install and sync UV with specified groups and extras'
author: 'Pycord Development <[email protected]>'
inputs:
groups:
description: "Comma-separated list of groups to sync"
required: false
default: ''
extras:
description: "Comma-separated list of extras to sync"
required: false
default: ''
frozen:
description: "Whether to sync with frozen dependencies"
required: false
default: 'true'
no_python_downloads:
description: "Whether to avoid downloading Python versions"
required: false
default: 'true'

runs:
using: "composite"
steps:
- name: "Install uv"
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: "Run UV sync"
shell: bash
run: |
cmd_args=("uv" "sync")

# groups
set +e
if [ -n "${{ inputs.groups }}" ]; then
IFS=',' read -ra PARSED_GROUPS <<< "${{ inputs.groups }}"
for group in "${PARSED_GROUPS[@]}"; do
group=$(echo "$group" | xargs)
if [ -n "$group" ]; then
cmd_args+=("--group" "$group")
fi
done
fi
set -e
echo "Groups: ${PARSED_GROUPS[*]}"

# extras
set +e
if [ -n "${{ inputs.extras }}" ]; then
IFS=',' read -ra PARSED_EXTRAS <<< "${{ inputs.extras }}"
for extra in "${PARSED_EXTRAS[@]}"; do
extra=$(echo "$extra" | xargs)
if [ -n "$extra" ]; then
cmd_args+=("--extra" "$extra")
fi
done
fi
set -e
echo "Extras: ${PARSED_EXTRAS[*]}"

echo "Executing: ${cmd_args[*]}"
"${cmd_args[@]}"
env:
UV_NO_PYTHON_DOWNLOADS: ${{ inputs.no_python_downloads == 'true' && '1' || '' }}
UV_FROZEN: ${{ inputs.frozen == 'true' && '1' || '' }}
10 changes: 4 additions & 6 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install uv"
uses: astral-sh/setup-uv@v7
python-version: "3.13"
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev --group docs
groups: 'dev,docs'
- name: "Check Links"
env:
SPHINXBUILD: ${{ github.workspace }}/.venv/bin/sphinx-build
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/docs-localization-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install uv"
uses: astral-sh/setup-uv@v7
python-version: "3.13"
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev --group docs --extra speed --extra voice
groups: 'dev,docs'
extras: 'speed,voice'
- name: "Get locales"
env:
SPHINXBUILD: ${{ github.workspace }}/.venv/bin/sphinx-build
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/docs-localization-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install uv"
uses: astral-sh/setup-uv@v7
python-version: "3.13"
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev --group docs --extra speed --extra voice
groups: 'dev,docs'
extras: 'speed,voice'
- name: "Get locales"
env:
SPHINXBUILD: ${{ github.workspace }}/.venv/bin/sphinx-build
Expand Down
39 changes: 15 additions & 24 deletions .github/workflows/lib-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install uv"
uses: astral-sh/setup-uv@v7
python-version: "3.13"
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev
groups: 'dev'
- name: "Run codespell"
run:
uv run codespell --ignore-words-list="groupt,nd,ot,ro,falsy,BU" \
Expand All @@ -60,13 +58,11 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install uv"
uses: astral-sh/setup-uv@v7
python-version: "3.13"
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev
groups: 'dev'
- name: "Run ruff linter check"
run: uv run ruff check .
- name: "Run ruff formatter check"
Expand All @@ -80,13 +76,11 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install uv"
uses: astral-sh/setup-uv@v7
python-version: "3.13"
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev
groups: 'dev'
- name: "Setup cache"
id: cache-mypy
uses: actions/cache@v4
Expand Down Expand Up @@ -114,13 +108,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: "Install uv"
uses: astral-sh/setup-uv@v7
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true

- name: Sync dependencies
run: uv sync --no-python-downloads --group dev
groups: 'dev'

- name: "Run tests"
run: uv run tox
10 changes: 4 additions & 6 deletions .github/workflows/sync-guild-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install uv"
uses: astral-sh/setup-uv@v7
python-version: "3.13"
- name: "Setup UV"
uses: ./.github/actions/sync-uv
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --no-python-downloads --group dev --group ci
groups: 'dev,ci'
- name: "Run guild features sync"
run: uv run python -m scripts.sync_guild_features
env:
Expand Down