Skip to content

Commit

Permalink
move to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Oct 11, 2024
1 parent b5963c5 commit 9e4f1c8
Show file tree
Hide file tree
Showing 6 changed files with 687 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .github/python-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13-dev
3.13
18 changes: 9 additions & 9 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: autofix.ci
on:
pull_request:
push:
branches: [ "main" ]
branches: [ "main", "ci" ]
permissions:
contents: read
concurrency:
Expand All @@ -13,18 +13,18 @@ jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: mhils/workflows/checkout@main
- uses: mhils/workflows/setup-python@main
with:
python-version-file: .github/python-version.txt
- uses: mhils/workflows/setup-uv@main
- name: Install the project
run: uv sync --dev

- run: pip install -r requirements-dev.txt
- run: pip install --no-deps -e .
- run: uv run ruff check --fix-only .
- run: uv run ruff format .

- run: ruff check --fix-only .
- run: ruff format .

- run: test/test_snapshot.py
- run: uv run test/test_snapshot.py

- uses: mhils/add-pr-ref-in-changelog@main

Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,28 @@ concurrency:

jobs:
lint:
uses: mhils/workflows/.github/workflows/python-tox.yml@v10
uses: mhils/workflows/.github/workflows/python-uv.yml@main
with:
cmd: tox -e lint

old-dependencies:
uses: mhils/workflows/.github/workflows/python-uv.yml@main
with:
cmd: tox -e old-dependencies

test:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
py: 3.13-dev
py: 3.13.0
args: --cov-fail-under=100
- os: macos-latest
py: 3.13-dev
py: 3.13.0
args: --cov-fail-under=100
- os: ubuntu-latest
py: 3.13-dev
py: 3.13.0
args: --cov-fail-under=100
- os: ubuntu-latest
py: 3.12.4
Expand All @@ -44,20 +49,20 @@ jobs:
py: 3.9.18
- os: ubuntu-latest
py: 3.8.18
uses: mhils/workflows/.github/workflows/python-tox.yml@v10
with:
cmd: tox -e py -- -vvv ${{ matrix.args }}
os: ${{ matrix.os }}
python-version: ${{ matrix.py }}
runs-on: ${{ matrix.os }}
steps:
- uses: mhils/workflows/composite/uv@main
with:
python-version: ${{ matrix.py }}
cmd: tox -e py -- -vvv ${{ matrix.args }}

build:
uses: mhils/workflows/.github/workflows/python-build.yml@v10
uses: mhils/workflows/.github/workflows/python-build.yml@main
permissions:
contents: read
id-token: write
attestations: write


attest:
needs: build
if: github.event_name != 'pull_request'
Expand All @@ -82,13 +87,13 @@ jobs:
- test
- build
- attest
uses: mhils/workflows/.github/workflows/alls-green.yml@v10
uses: mhils/workflows/.github/workflows/alls-green.yml@main
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: '["attest"]'

deploy:
uses: mhils/workflows/.github/workflows/python-deploy.yml@v10
uses: mhils/workflows/.github/workflows/python-deploy.yml@main
with:
artifact-name: wheels
needs: check
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ Issues = "https://github.com/mitmproxy/pdoc/issues"
[project.scripts]
pdoc = "pdoc.__main__:cli"

[project.optional-dependencies]
dev = [
[tool.uv]
dev-dependencies = [
"tox",
"tox-uv",
"ruff",
"mypy",
"types-pygments",
"pytest",
"pytest-cov",
"pytest-timeout",
"hypothesis",
"pygments >= 2.14.0",
"pdoc-pyo3-sample-library==1.0.11",
"pdoc-pyo3-sample-library",
]

[build-system]
Expand Down Expand Up @@ -112,15 +112,16 @@ legacy_tox_ini = """
envlist = lint, py
skipsdist = True
toxworkdir = {env:TOX_WORK_DIR:.tox}
runner = uv-venv-lock-runner
[testenv]
deps =
-r requirements-dev.txt
-e .
commands =
pdoc --version
pytest --cov=pdoc --cov-report term-missing {posargs:-m "not slow"}
[testenv:old-dependencies]
uv_resolution = "lowest"
[testenv:lint]
commands =
ruff check . {posargs}
Expand Down
80 changes: 0 additions & 80 deletions requirements-dev.txt

This file was deleted.

Loading

0 comments on commit 9e4f1c8

Please sign in to comment.