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
15 changes: 6 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Dump GitHub context
env:
Expand All @@ -19,14 +20,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install build dependencies
run: pip install build
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build distribution
run: python -m build
run: uv build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.13.0
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
run: uv publish
9 changes: 3 additions & 6 deletions .github/workflows/smokeshow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
permissions:
statuses: write

env:
UV_SYSTEM_PYTHON: 1

jobs:
smokeshow:
runs-on: ubuntu-latest
Expand All @@ -25,14 +22,14 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'
python-version-file: ".python-version"
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: |
requirements**.txt
pyproject.toml
- run: uv pip install -r requirements-tests.txt
uv.lock
- run: uv sync --locked --all-extras --dev
- uses: actions/download-artifact@v6
with:
name: coverage-html
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test-redistribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
- opened
- synchronize

env:
UV_SYSTEM_PYTHON: 1

jobs:
test-redistribute:
runs-on: ubuntu-latest
Expand All @@ -24,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version-file: ".python-version"
- name: Install build dependencies
run: pip install build
- name: Build source distribution
Expand All @@ -36,7 +33,7 @@ jobs:
- name: Install test dependencies
run: |
cd dist/annotated_doc*/
pip install -r requirements-tests.txt
pip install --group dev .
- name: Run source distribution tests
run: |
cd dist/annotated_doc*/
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- cron: "0 0 * * 1"

env:
UV_SYSTEM_PYTHON: 1
UV_NO_SYNC: true

jobs:
test:
Expand Down Expand Up @@ -48,6 +48,8 @@ jobs:
python-version: "3.13"
fail-fast: false
runs-on: ${{ matrix.os }}
env:
UV_PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
Expand All @@ -57,24 +59,23 @@ jobs:
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
uv.lock
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- name: Install Dependencies
run: uv pip install -r requirements-tests.txt
run: uv sync --locked --all-extras --dev
- name: Lint
run: bash scripts/lint.sh
run: uv run bash scripts/lint.sh
- run: mkdir coverage
- name: Test
run: bash scripts/test.sh
run: uv run bash scripts/test.sh
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
Expand All @@ -93,15 +94,14 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'
python-version-file: ".python-version"
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
version: "0.4.15"
enable-cache: true
cache-dependency-glob: |
requirements**.txt
pyproject.toml
uv.lock
- name: Get coverage files
uses: actions/download-artifact@v6
with:
Expand All @@ -115,17 +115,17 @@ jobs:
with:
limit-access-to-actor: true
- name: Install Dependencies
run: uv pip install -r requirements-tests.txt
run: uv sync --locked --all-extras --dev
- run: ls -la coverage
- run: coverage combine coverage
- run: coverage html --title "Coverage for ${{ github.sha }}"
- run: uv run coverage combine coverage
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
- name: Store coverage HTML
uses: actions/upload-artifact@v5
with:
name: coverage-html
path: htmlcov
include-hidden-files: true
- run: coverage report --fail-under=100
- run: uv run coverage report --fail-under=100

# https://github.com/marketplace/actions/alls-green#why
alls-green: # This job does nothing and is only used for the branch protection
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
13 changes: 11 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ Repository = "https://github.com/fastapi/annotated-doc"
Issues = "https://github.com/fastapi/annotated-doc/issues"
Changelog = "https://github.com/fastapi/annotated-doc/release-notes.md"

[dependency-groups]
dev = [
"coverage[toml]>=7.6.1",
"mypy==1.14.1",
"pytest>=8.3.5",
"ruff==0.14.3",
"smokeshow>=0.5.0",
"typing-extensions>=4.13.2 ; python_full_version < '3.9'",
]

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
Expand Down Expand Up @@ -101,6 +111,5 @@ distribution = true
[tool.pdm.build]
source-includes = [
"tests/",
"requirements*.txt",
"scripts/",
]
]
8 changes: 0 additions & 8 deletions requirements-tests.txt

This file was deleted.

Loading
Loading