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

Declare 3.13 support #48

Merged
merged 2 commits into from
Sep 7, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Supported Versions

| Version | Supported |
|---------|--------------------|
| ------- | ------------------ |
| 1.0 + | :white_check_mark: |
| < 1.0 | :x: |

Expand Down
42 changes: 19 additions & 23 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Check
on:
workflow_dispatch:
push:
branches: [ "main" ]
tags: [ "*" ]
branches: ["main"]
tags: ["*"]
pull_request:
concurrency:
group: check-${{ github.ref }}
Expand All @@ -16,6 +16,7 @@ jobs:
fail-fast: false
matrix:
py:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
Expand All @@ -32,27 +33,21 @@ jobs:
python-version: "3.12"
- name: install tox-uv
run: python -m pip install tox-uv
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: install tarpaulin
run: cargo install cargo-tarpaulin
- uses: moonrepo/setup-rust@v1
with:
cache-base: main
bins: cargo-tarpaulin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: setup python for test ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Pick environment to run
run: |
import codecs; import os; import sys
env = "TOXENV=py{}{}\n".format(*sys.version_info[0:2])
print("Picked:\n{}for{}".format(env, sys.version))
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
file_handler.write(env)
shell: python
allow-prereleases: true
- name: setup test suite
run: tox -vv --notest
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }}
- name: run test suite
run: tox --skip-pkg-install
run: tox run --skip-pkg-install -e ${{ matrix.py }}

check:
name: tox env ${{ matrix.tox_env }}
Expand All @@ -72,9 +67,10 @@ jobs:
python-version: "3.12"
- name: install tox-uv
run: python -m pip install tox-uv
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: run check for ${{ matrix.tox_env }}
run: python -m tox -e ${{ matrix.tox_env }}
env:
UPGRADE_ADVISORY: "yes"
- uses: moonrepo/setup-rust@v1
with:
cache-base: main
- name: Setup test suite
run: tox -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
- name: Run test suite
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build
on:
workflow_dispatch:
push:
branches: [ "main" ]
tags: [ "*" ]
branches: ["main"]
tags: ["*"]
pull_request:
schedule:
- cron: "0 8 * * *"
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --interpreter ${{ matrix.platform.interpreter || '3.8' }}
sccache: 'true'
sccache: "true"
manylinux: ${{ matrix.platform.manylinux || 'auto' }}
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -71,7 +71,7 @@ jobs:
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --interpreter ${{ matrix.platform.interpreter || '3.8' }}
sccache: 'true'
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -94,7 +94,7 @@ jobs:
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --interpreter "3.8 pypy3.8 pypy3.9 pypy3.10"
sccache: 'true'
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
permissions:
id-token: write
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ linux, windows, macos, sdist ]
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
Expand Down
19 changes: 13 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,34 @@ repos:
rev: 0.29.2
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
args: ["--verbose"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: [ "--write-changes" ]
additional_dependencies: ["tomli>=2.0.1"]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
rev: "1.3.2"
hooks:
- id: tox-ini-fmt
args: [ "-p", "fix" ]
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.2.1"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.3"
rev: "v0.6.4"
hooks:
- id: ruff-format
- id: ruff
args: [ "--fix", "--unsafe-fixes", "--exit-non-zero-on-fix" ]
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.3.3"
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- "@prettier/[email protected]"
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ To work on the project:
cargo test
```


## License

By contributing to pyproject-rust-format, you agree that your contributions
will be licensed under the [MIT License](LICENSE).

Expand All @@ -38,5 +38,6 @@ with a different PATH. To fix it, put the following in `.cargo/config.toml`:
[env]
PYO3_PYTHON = "./.venv/bin/python"
```

And make sure you have a `.venv` folder with Python in it. This will ensure all
runs use the same Python and don't reconfigure.
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "maturin"
requires = [
"maturin>=1.5.1",
"maturin>=1.7.1",
]

[project]
Expand All @@ -27,6 +27,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = [
"version",
Expand All @@ -35,7 +36,7 @@ dependencies = [
]
optional-dependencies.test = [
"covdefaults>=2.3",
"pytest>=8.2",
"pytest>=8.3.2",
"pytest-cov>=5",
]
urls."Bug Tracker" = "https://github.com/tox-dev/pyproject-fmt-rust/issues"
Expand Down Expand Up @@ -100,6 +101,9 @@ lint.preview = true
builtin = "clear,usage,en-GB_to_en-US"
count = true

[tool.pyproject-fmt]
max_supported_python = "3.13"

[tool.pytest]
ini_options.testpaths = [
"tests",
Expand Down
27 changes: 13 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[tox]
requires =
tox>=4.2
tox-uv>=1.11.3
env_list =
fix
py312
py311
py310
py39
py38
type
readme
docs
3.13
3.12
3.11
3.10
3.9
3.8
skip_missing_interpreters = true

[testenv]
Expand All @@ -37,16 +39,14 @@ allowlist_externals =
description = run static analysis and style check using flake8
skip_install = true
deps =
pre-commit>=3.7
pre-commit-uv>=4.1
commands =
pre-commit run --all-files --show-diff-on-failure

[testenv:type]
description = run type check on code base
deps =
mypy==1.10
set_env =
{tty:MYPY_FORCE_COLOR = 1}
mypy==1.11.2
commands =
mypy src
mypy tests
Expand All @@ -55,10 +55,10 @@ commands =
description = check that the long description is valid
skip_install = true
deps =
build[virtualenv]>=1.2.1
twine>=5
build[uv]>=1.2.2
twine>=5.1.1
commands =
python -m build --sdist --wheel -o {envtmpdir} .
pyproject-build --installer uv --sdist --wheel -o {envtmpdir} .
twine check {envtmpdir}/*

[testenv:docs]
Expand All @@ -76,6 +76,5 @@ extras =
docs
test
commands =
python -m pip list --format=columns
uv pip tree
python -c 'import sys; print(sys.executable)'
uv_seed = true