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 b06b586
Show file tree
Hide file tree
Showing 6 changed files with 697 additions and 112 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
43 changes: 28 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,34 @@ concurrency:

jobs:
lint:
uses: mhils/workflows/.github/workflows/python-tox.yml@v10
with:
cmd: tox -e lint
runs-on: ubuntu-latest
steps:
- uses: mhils/workflows/checkout@main
- uses: mhils/workflows/setup-python@main
- uses: mhils/workflows/setup-uv@main
- run: uv run tox -e lint

old-dependencies:
runs-on: ubuntu-latest
steps:
- uses: mhils/workflows/checkout@main
- uses: mhils/workflows/setup-python@main
- uses: mhils/workflows/setup-uv@main
- run: uv run 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 +55,22 @@ 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/checkout@main
- uses: mhils/workflows/setup-python@main
with:
python-version: ${{ matrix.py }}
- uses: mhils/workflows/setup-uv@main
- run: uv run 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 +95,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 b06b586

Please sign in to comment.