Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

Commit eca71a9

Browse files
authored
Merge branch 'main' into henryiii/fix/27
2 parents 6c8af13 + f5c04de commit eca71a9

File tree

5 files changed

+53
-57
lines changed

5 files changed

+53
-57
lines changed

.github/workflows/check.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,58 @@ jobs:
2727
- windows-latest
2828
- macos-latest
2929
steps:
30-
- name: setup python for tox
31-
uses: actions/setup-python@v5
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- name: Install the latest version of uv
34+
uses: astral-sh/setup-uv@v3
3235
with:
33-
python-version: "3.12"
34-
- name: install tox-uv
35-
run: python -m pip install tox-uv
36+
enable-cache: true
37+
cache-dependency-glob: "pyproject.toml"
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Install tox
40+
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
41+
- name: Install Python
42+
if: startsWith(matrix.env, '3.') && matrix.env != '3.13'
43+
run: uv python install --python-preference only-managed ${{ matrix.env }}
3644
- uses: moonrepo/setup-rust@v1
3745
with:
3846
cache-base: main
3947
bins: cargo-tarpaulin
4048
env:
4149
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
- name: setup python for test ${{ matrix.py }}
43-
uses: actions/setup-python@v5
44-
with:
45-
python-version: ${{ matrix.py }}
46-
allow-prereleases: true
4750
- name: setup test suite
4851
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }}
4952
- name: run test suite
5053
run: tox run --skip-pkg-install -e ${{ matrix.py }}
54+
env:
55+
PYTEST_ADDOPTS: "-vv --durations=20"
5156

5257
check:
53-
name: tox env ${{ matrix.tox_env }}
58+
name: tox env ${{ matrix.env }}
5459
runs-on: ubuntu-latest
5560
strategy:
5661
fail-fast: false
5762
matrix:
58-
tox_env:
63+
env:
5964
- type
6065
- dev
61-
- readme
66+
- pkg_meta
6267
steps:
6368
- uses: actions/checkout@v4
64-
- name: setup Python 3.12
65-
uses: actions/setup-python@v5
6669
with:
67-
python-version: "3.12"
68-
- name: install tox-uv
69-
run: python -m pip install tox-uv
70-
- uses: moonrepo/setup-rust@v1
70+
fetch-depth: 0
71+
- name: Install the latest version of uv
72+
uses: astral-sh/setup-uv@v3
7173
with:
72-
cache-base: main
74+
enable-cache: true
75+
cache-dependency-glob: "pyproject.toml"
76+
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
- name: Install tox
78+
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
7379
- name: Setup test suite
74-
run: tox -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
80+
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
7581
- name: Run test suite
76-
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
82+
run: tox run --skip-pkg-install -e ${{ matrix.env }}
83+
env:
84+
PYTEST_ADDOPTS: "-vv --durations=20"

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
runs-on: ubuntu-latest
122122
environment:
123123
name: release
124-
url: https://pypi.org/project/pyproject-fmt-rust
124+
url: https://pypi.org/project/pyproject-fmt-rust/${{ github.ref_name }}
125125
permissions:
126126
id-token: write
127127
if: "startsWith(github.ref, 'refs/tags/')"

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ repos:
1515
- id: codespell
1616
additional_dependencies: ["tomli>=2.0.1"]
1717
- repo: https://github.com/tox-dev/tox-ini-fmt
18-
rev: "1.3.2"
18+
rev: "1.4.0"
1919
hooks:
2020
- id: tox-ini-fmt
2121
args: ["-p", "fix"]
2222
- repo: https://github.com/tox-dev/pyproject-fmt
23-
rev: "2.2.1"
23+
rev: "2.2.3"
2424
hooks:
2525
- id: pyproject-fmt
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: "v0.6.4"
27+
rev: "v0.6.5"
2828
hooks:
2929
- id: ruff-format
3030
- id: ruff

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyproject-fmt-rust?style=flat-square)](https://pypi.org/project/pyproject-fmt-rust)
66
[![Downloads](https://static.pepy.tech/badge/pyproject-fmt-rust/month)](https://pepy.tech/project/pyproject-fmt-rust)
77
[![PyPI - License](https://img.shields.io/pypi/l/pyproject-fmt-rust?style=flat-square)](https://opensource.org/licenses/MIT)
8-
[![check](https://github.com/tox-dev/pyproject-fmt-rust/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/pyproject-fmt-rust/actions/workflows/check.yml)
8+
[![check](https://github.com/tox-dev/pyproject-fmt-rust/actions/workflows/check.yaml/badge.svg)](https://github.com/tox-dev/pyproject-fmt-rust/actions/workflows/check.yaml)

tox.ini

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,36 @@ requires =
44
tox-uv>=1.11.3
55
env_list =
66
fix
7-
type
8-
readme
9-
docs
107
3.13
118
3.12
129
3.11
1310
3.10
1411
3.9
1512
3.8
16-
skip_missing_interpreters = true
13+
type
14+
pkg_meta
1715

1816
[testenv]
19-
description = run the unit tests with pytest under {basepython}
17+
description = run the unit tests with pytest under {base_python}
2018
package = wheel
19+
wheel_build_env = .pkg
2120
extras =
21+
graphviz
2222
test
23+
pass_env =
24+
PYTEST_*
2325
set_env =
24-
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
25-
COVERAGE_PROCESS_START = {toxinidir}/setup.cfg
26-
_COVERAGE_SRC = {envsitepackagesdir}/sphinx_argparse_cli
26+
COVERAGE_FILE = {work_dir}/.coverage.{env_name}
2727
commands =
28-
cargo tarpaulin --no-default-features --out Html --output-dir {env_dir}
2928
python -m pytest {tty:--color=yes} {posargs: \
30-
--junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}pyproject_fmt_rust \
31-
--cov {toxinidir}{/}tests --cov-fail-under=100 \
29+
--cov {env_site_packages_dir}{/}pyproject_fmt_rust --cov {tox_root}{/}tests \
3230
--cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
33-
--cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \
31+
--cov-report html:{env_tmp_dir}{/}htmlcov --cov-report xml:{work_dir}{/}coverage.{env_name}.xml \
32+
--junitxml {work_dir}{/}junit.{env_name}.xml \
3433
tests}
35-
allowlist_externals =
36-
cargo
3734

3835
[testenv:fix]
39-
description = run static analysis and style check using flake8
36+
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
4037
skip_install = true
4138
deps =
4239
pre-commit-uv>=4.1
@@ -51,30 +48,21 @@ commands =
5148
mypy src
5249
mypy tests
5350

54-
[testenv:readme]
51+
[testenv:pkg_meta]
5552
description = check that the long description is valid
5653
skip_install = true
5754
deps =
58-
build[uv]>=1.2.2
55+
check-wheel-contents>=0.6
5956
twine>=5.1.1
57+
uv>=0.4.10
6058
commands =
61-
pyproject-build --installer uv --sdist --wheel -o {envtmpdir} .
62-
twine check {envtmpdir}/*
63-
64-
[testenv:docs]
65-
description = build documentation
66-
extras =
67-
docs
68-
commands =
69-
sphinx-build -d "{envtmpdir}{/}doctree" docs "{toxworkdir}{/}docs_out" --color -b html {posargs}
70-
python -c 'print(r"documentation available under file://{toxworkdir}{/}docs_out{/}index.html")'
59+
uv build --sdist --wheel --out-dir {env_tmp_dir} .
60+
twine check {env_tmp_dir}{/}*
61+
check-wheel-contents --no-config {env_tmp_dir}
7162

7263
[testenv:dev]
7364
description = generate a DEV environment
7465
package = editable
75-
extras =
76-
docs
77-
test
7866
commands =
7967
uv pip tree
8068
python -c 'import sys; print(sys.executable)'

0 commit comments

Comments
 (0)