Skip to content
Draft
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: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ ignore =

max-line-length=120
max-complexity=39

extend-exclude =
.venv
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
/.github/workflows/docs-localization-download.yml @Pycord-Development/maintain-translations
/.github/workflows/docs-localization-upload.yml @Pycord-Development/maintain-translations
/crowdin.yml @Pycord-Development/maintain-translations
/requirements/_locale.txt @Pycord-Development/maintain-translations
/CHANGELOG.md @Pycord-Development/squiddo-typo-check
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Version | Supported |
| ------- | ------------------ |
| 2.x | :white_check_mark: |
| <2.6.1 | :x: |
| \<2.6.1 | :x: |

## Reporting a Vulnerability

Expand Down
37 changes: 0 additions & 37 deletions .github/actions/setup-python-dev/action.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/actions/setup-uv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "Setup uv"
description: "Install uv and sync the environment from uv.lock. Requires actions/checkout to have run first."

inputs:
groups:
description: "Dependency groups to sync, comma- or space-separated. Empty syncs no groups."
required: false
default: ""
extras:
description: "Extras to sync, comma- or space-separated. Empty syncs no extras."
required: false
default: ""
frozen:
description: "Sync straight from uv.lock without re-resolving."
required: false
default: "true"
cache:
description: "Cache the uv download and its dependency cache."
required: false
default: "true"
python-version:
description: "Python version to sync against. Defaults to the project's .python-version."
required: false
default: ""

runs:
using: "composite"
steps:
- name: "Install uv"
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: ${{ inputs.cache }}
cache-dependency-glob: "uv.lock"
python-version: ${{ inputs.python-version }}

- name: "Sync environment"
shell: bash
env:
INPUT_GROUPS: ${{ inputs.groups }}
INPUT_EXTRAS: ${{ inputs.extras }}
INPUT_FROZEN: ${{ inputs.frozen }}
run: |
set -euo pipefail

args=(--no-default-groups)
if [[ "$INPUT_FROZEN" == "true" ]]; then
args+=(--frozen)
fi
for group in ${INPUT_GROUPS//,/ }; do
args+=(--group "$group")
done
for extra in ${INPUT_EXTRAS//,/ }; do
args+=(--extra "$extra")
done

echo "::notice::uv sync ${args[*]}"
uv sync "${args[@]}"

- name: "Put the synced environment on PATH"
shell: bash
run: |
set -euo pipefail
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "$GITHUB_WORKSPACE/.venv/Scripts" >> "$GITHUB_PATH"
else
echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH"
fi
21 changes: 8 additions & 13 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ on:
paths:
- "discord/**"
- "docs/**"
- "requirements/**"
- "uv.lock"
- ".github/workflows/docs-checks.yml"
- ".readthedocs.yml"
- "LICENSE"
- "MANIFEST.in"
- "README.rst"
- "*.toml"
- "*.py"
Expand Down Expand Up @@ -57,11 +56,10 @@ jobs:
const matches = (file) => (
file.startsWith('discord/') ||
file.startsWith('docs/') ||
file.startsWith('requirements/') ||
file === 'uv.lock' ||
file === '.github/workflows/docs-checks.yml' ||
file === '.readthedocs.yml' ||
file === 'LICENSE' ||
file === 'MANIFEST.in' ||
file === 'README.rst' ||
(!file.includes('/') && file.endsWith('.toml')) ||
(!file.includes('/') && file.endsWith('.py'))
Expand All @@ -85,17 +83,14 @@ jobs:
steps:
- name: "Checkout Repository"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: "Setup Python"
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
fetch-depth: 0
- name: "Setup uv"
uses: ./.github/actions/setup-uv
with:
python-version: "3.14"
cache: "pip"
cache-dependency-path: "requirements/docs.txt"
check-latest: true
- name: Install dependencies
run: |
python -m pip install -U pip
pip install ".[docs,voice]"
groups: "docs"
extras: "voice"
- name: "Check Links"
if: ${{ github.event_name == 'schedule' || inputs.with_linkcheck }}
run: |
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/docs-json-export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,16 @@ jobs:
name: Export docs.json
runs-on: ubuntu-latest
steps:
- name: Checkout repository
id: checkout
- name: "Checkout Repository"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
id: setup-python
with:
fetch-depth: 0
- name: "Setup uv"
uses: ./.github/actions/setup-uv
with:
python-version: "3.14"
cache: "pip"
cache-dependency-path: "requirements/docs.txt"
check-latest: true
- name: Install dependencies
id: install-deps
run: |
python -m pip install -U pip
pip install ".[docs,voice]"
pip install beautifulsoup4
groups: "docs"
extras: "voice"
- name: Build Sphinx HTML docs
id: build-sphinx
run: sphinx-build -b html docs docs/_build/html
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/docs-localization-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-tags: true
- name: "Install Python"
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
fetch-depth: 0
- name: "Setup uv"
uses: ./.github/actions/setup-uv
with:
python-version: "3.14"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
groups: "docs"
extras: "speed,voice"
- name: "Get locales"
run: |
make html
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/docs-localization-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-tags: true
- name: "Install Python"
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
fetch-depth: 0
- name: "Setup uv"
uses: ./.github/actions/setup-uv
with:
python-version: "3.14"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
groups: "docs"
extras: "speed,voice"
- name: "Get locales"
run: |
make html
Expand Down
Loading
Loading