mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use `astral-sh/ruff-action
and
astral-sh/setup-uv
` in GitHub Actions (#13198)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
parent
90d50c1320
commit
3967c7d3ac
9
.github/workflows/builddoc.yml
vendored
9
.github/workflows/builddoc.yml
vendored
@ -31,11 +31,10 @@ jobs:
|
||||
- name: Install graphviz
|
||||
run: sudo apt-get install --no-install-recommends --yes graphviz
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install .[docs]
|
||||
- name: Render the documentation
|
||||
|
9
.github/workflows/create-release.yml
vendored
9
.github/workflows/create-release.yml
vendored
@ -35,11 +35,10 @@ jobs:
|
||||
with:
|
||||
python-version: "3"
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
|
||||
- name: Install build dependencies (pypa/build, twine)
|
||||
run: |
|
||||
|
52
.github/workflows/lint.yml
vendored
52
.github/workflows/lint.yml
vendored
@ -31,19 +31,17 @@ jobs:
|
||||
RUFF_VERSION=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml)
|
||||
echo "RUFF_VERSION=$RUFF_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Ruff
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
--write-out "%{stderr}Downloaded: %{url}\n"
|
||||
"https://astral.sh/ruff/$RUFF_VERSION/install.sh"
|
||||
| sh
|
||||
- name: Install Ruff ${{ env.RUFF_VERSION }}
|
||||
uses: astral-sh/ruff-action@v3
|
||||
with:
|
||||
args: --version
|
||||
version: ${{ env.RUFF_VERSION }}
|
||||
|
||||
- name: Lint with Ruff
|
||||
run: ruff check . --output-format github
|
||||
run: ruff check --output-format=github
|
||||
|
||||
- name: Format with Ruff
|
||||
run: ruff format . --diff
|
||||
run: ruff format --diff
|
||||
|
||||
mypy:
|
||||
runs-on: ubuntu-latest
|
||||
@ -57,11 +55,10 @@ jobs:
|
||||
with:
|
||||
python-version: "3"
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install ".[lint,test]"
|
||||
- name: Type check with mypy
|
||||
@ -79,11 +76,10 @@ jobs:
|
||||
with:
|
||||
python-version: "3"
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install ".[lint,test]"
|
||||
- name: Type check with pyright
|
||||
@ -101,11 +97,10 @@ jobs:
|
||||
with:
|
||||
python-version: "3"
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install --upgrade sphinx-lint
|
||||
- name: Lint documentation with sphinx-lint
|
||||
@ -123,11 +118,10 @@ jobs:
|
||||
with:
|
||||
python-version: "3"
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install --upgrade twine build
|
||||
- name: Lint with twine
|
||||
|
52
.github/workflows/main.yml
vendored
52
.github/workflows/main.yml
vendored
@ -58,11 +58,10 @@ jobs:
|
||||
- name: Install graphviz
|
||||
run: sudo apt-get install --no-install-recommends --yes graphviz
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install .[test]
|
||||
- name: Install Docutils ${{ matrix.docutils }}
|
||||
@ -198,9 +197,10 @@ jobs:
|
||||
- name: Install graphviz
|
||||
run: choco install --no-progress graphviz
|
||||
- name: Install uv
|
||||
run: >
|
||||
Invoke-WebRequest -Uri "https://astral.sh/uv/install.ps1"
|
||||
| Invoke-Expression
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install .[test]
|
||||
- name: Test with pytest
|
||||
@ -232,11 +232,10 @@ jobs:
|
||||
- name: Install graphviz
|
||||
run: sudo apt-get install --no-install-recommends --yes graphviz
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install .[test]
|
||||
- name: Install Docutils' HEAD
|
||||
@ -266,11 +265,10 @@ jobs:
|
||||
- name: Install graphviz
|
||||
run: sudo apt-get install --no-install-recommends --yes graphviz
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv pip install .[test] --resolution lowest-direct
|
||||
@ -298,11 +296,10 @@ jobs:
|
||||
- name: Check Python version
|
||||
run: python --version --version
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install .[test]
|
||||
- name: Test with pytest
|
||||
@ -330,11 +327,10 @@ jobs:
|
||||
- name: Install graphviz
|
||||
run: sudo apt-get install --no-install-recommends --yes graphviz
|
||||
- name: Install uv
|
||||
run: >
|
||||
curl --no-progress-meter --location --fail
|
||||
--proto '=https' --tlsv1.2
|
||||
"https://astral.sh/uv/install.sh"
|
||||
| sh
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: uv pip install .[test] pytest-cov
|
||||
- name: Test with pytest
|
||||
|
14
.github/workflows/transifex.yml
vendored
14
.github/workflows/transifex.yml
vendored
@ -27,8 +27,13 @@ jobs:
|
||||
mkdir -p /tmp/tx_cli && cd $_
|
||||
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
|
||||
shell: bash
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: pip install --upgrade babel jinja2
|
||||
run: uv pip install --upgrade babel jinja2
|
||||
- name: Extract translations from source code
|
||||
run: python utils/babel_runner.py extract
|
||||
- name: Push translations to transifex.com
|
||||
@ -58,8 +63,13 @@ jobs:
|
||||
mkdir -p /tmp/tx_cli && cd $_
|
||||
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
|
||||
shell: bash
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: latest
|
||||
enable-cache: false
|
||||
- name: Install dependencies
|
||||
run: pip install --upgrade babel jinja2
|
||||
run: uv pip install --upgrade babel jinja2
|
||||
- name: Extract translations from source code
|
||||
run: python utils/babel_runner.py extract
|
||||
- name: Pull translations from transifex.com
|
||||
|
Loading…
Reference in New Issue
Block a user