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

Commit

Permalink
Merge branch 'main' into henryiii/fix/27
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Sep 8, 2024
2 parents 009d817 + e22be80 commit 6c8af13
Show file tree
Hide file tree
Showing 15 changed files with 191 additions and 175 deletions.
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.
Loading

0 comments on commit 6c8af13

Please sign in to comment.