Skip to content
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
37 changes: 29 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,42 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
schedule:
- cron: "12 12 * * MON-FRI/3"

jobs:
build-package:
permissions:
attestations: write
contents: read
id-token: write
name: Build & verify package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check built Python package
id: baipp
uses: hynek/build-and-inspect-python-package@v2
with:
upload-name-suffix: -${{ matrix.python-version }}-${{ matrix.os }}
attest-build-provenance-github: 'true'
outputs:
# Outputs the supported Python versions as a JSON array, from the project classifiers
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}

CI-Python:
runs-on: ubuntu-latest
needs: build-package
env:
PYTHONDEVMODE: 1
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ${{ fromJson(needs.build-package.outputs.python-versions) }}
# Empty is latest, head is latest from GitHub
pdm-version: [""]
os: [ubuntu-latest]
Expand All @@ -33,6 +59,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pdm-project/setup-pdm@v4
name: Setup PDM
with:
Expand Down Expand Up @@ -79,10 +107,3 @@ jobs:
run: |
pdm build
# Do not upload to PyPI, here we only want to check that the build works
# XXX Check valid wheels?


- name: Check Python package
uses: hynek/build-and-inspect-python-package@v2
with:
upload-name-suffix: -${{ matrix.python-version }}-${{ matrix.os }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: fix-byte-order-marker

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
rev: 0.29.2
hooks:
- id: check-github-workflows
args: ["--verbose"]
Expand Down
32 changes: 17 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ requires =
env_list =
clean
report
py{313, 312, 311, 310, 39}-pdm{218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27}
py{313, 312, 311, 310, 39}-poetry{18, 17, 16}
py{313, 312, 311, 310, 39}-pdm{218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}
py{313, 312, 311, 310, 39}-poetry{18, 17, 16, HEAD}

[testenv]
set_env =
py{39,310,311,312,313}-pdm{27,28,29,210,211,212,213,214,215,216,217,218}: COVERAGE_FILE = .coverage.{envname}
py{39,310,311,312,313}-poetry{16, 17, 18}: COVERAGE_FILE = .coverage.{envname}
py{39,310,311,312,313}-pdm{27,28,29,210,211,212,213,214,215,216,217,218, HEAD}: COVERAGE_FILE = .coverage.{envname}
py{39,310,311,312,313}-poetry{16, 17, 18, HEAD}: COVERAGE_FILE = .coverage.{envname}
commands =
pytest --cov --cov-append --cov-report=term-missing {posargs:-vv} --cov-config=pyproject.toml
allowlist_externals =
coverage
pdm
pytest
depends =
report: py{313, 312, 311, 310, 39}-pdm{218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27}
report: py{313, 312, 311, 310, 39}-poetry{18, 17, 16}
py{313, 312, 311, 310, 39}-pdm{218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27}: clean
py{313, 312, 311, 310, 39}-poetry{18, 17, 16}: clean
report: py{313, 312, 311, 310, 39}-pdm{218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}
report: py{313, 312, 311, 310, 39}-poetry{18, 17, 16, HEAD}
py{313, 312, 311, 310, 39}-pdm{218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}: clean
py{313, 312, 311, 310, 39}-poetry{18, 17, 16, HEAD}: clean

[testenv:clean]
skip_install = true
Expand All @@ -41,7 +41,7 @@ commands =
coverage html
coverage xml

[testenv:py{39,310,311,312}-pdm{27,28,29,210,211,212,213,214,215,216,217,218}]
[testenv:py{39,310,311,312,313}-pdm{27,28,29,210,211,212,213,214,215,216,217,218,HEAD}]
package = editable
deps =
-r requirements-tox.txt
Expand All @@ -57,20 +57,22 @@ deps =
pdm27: pdm<2.8,>=2.7
pdm28: pdm<2.9,>=2.8
pdm29: pdm<2.10,>=2.9
pdmHEAD: pdm@ git+https://github.com/pdm-project/pdm.git

[testenv:py{312, 311, 310, 39}-poetry{16, 17, 18}]
[testenv:py{313,312, 311, 310, 39}-poetry{16, 17, 18, HEAD}]
package = editable
deps =
-r requirements-tox.txt
poetry16: poetry<1.7,>=1.6
poetry17: poetry<1.8,>=1.7
poetry18: poetry<1.9,>=1.8
poetryHEAD: poetry@ git+https://github.com/python-poetry/poetry.git

[gh]
python =
3.9= py39-pdm{27,28,29,210,211,212,213,214,215,216,217,218},py39-poetry{16, 17, 18}, report, clean
3.10= py310-pdm{27,28,29,210,211,212,213,214,215,216,217,218}, py310-poetry{16, 17, 18}, report, clean
3.11= py311-pdm{27,28,29,210,211,212,213,214,215,216,217,218}, py311-poetry{16, 17, 18}, report, clean
3.12= py312-pdm{27,28,29,210,211,212,213,214,215,216,217,218}, py312-poetry{16, 17, 18}, report, clean
3.13= py313-pdm{27,28,29,210,211,212,213,214,215,216,217,218}, py313-poetry{16, 17, 18}, report, clean
3.9= py39-pdm{27,28,29,210,211,212,213,214,215,216,217,218,HEAD},py39-poetry{16, 17, 18, HEAD}, report, clean
3.10= py310-pdm{27,28,29,210,211,212,213,214,215,216,217,218,HEAD}, py310-poetry{16, 17, 18, HEAD}, report, clean
3.11= py311-pdm{27,28,29,210,211,212,213,214,215,216,217,218,HEAD}, py311-poetry{16, 17, 18, HEAD}, report, clean
3.12= py312-pdm{27,28,29,210,211,212,213,214,215,216,217,218,HEAD}, py312-poetry{16, 17, 18, HEAD}, report, clean
3.13= py313-pdm{27,28,29,210,211,212,213,214,215,216,217,218,HEAD}, py313-poetry{16, 17, 18, HEAD}, report, clean
fail_on_no_env = True