Skip to content

Commit

Permalink
fix leftover todos and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ariebovenberg committed Jun 15, 2024
1 parent 0c39c8c commit c1db824
Show file tree
Hide file tree
Showing 30 changed files with 1,165 additions and 871 deletions.
79 changes: 63 additions & 16 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ on:
workflow_dispatch:

jobs:
Test:
runs-on: ${{ matrix.os }}
test-python-version:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Note: pypy/pytest fails sometimes (https://github.com/pypy/pypy/issues/3959)
python-version: [
# "3.9",
# "3.10",
# "3.11",
"3.9",
"3.10",
"3.11",
"3.12",
# "3.13.0b2",
"3.13-dev",
# FUTURE: pypy builds current fail. Uncomment when fixed.
# Low prio because pure-Python version is available.
# NOTE: pypy/pytest fails sometimes (https://github.com/pypy/pypy/issues/3959)
# "pypy3.9",
# "pypy3.10"
]
Expand All @@ -32,33 +34,77 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: "Test Rust"
if: matrix.os == 'ubuntu-latest'
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.12') }}
run: |
cargo test
- name: Install and test
if: ${{ !((matrix.python-version == '3.12') && (matrix.os == 'ubuntu-latest')) }}
shell: bash
run: |
pip install .
pip install -r requirements/test.txt
pytest tests/
- name: Install and test (incl coverage)
if: ${{ (matrix.python-version == '3.12') && (matrix.os == 'ubuntu-latest') }}
Test-os:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1

- uses: actions/setup-python@v5
if: ${{ !(matrix.os == 'windows-latest') }}
with:
python-version: '3.12'

# ensure 32-bit target is tested
- uses: actions/setup-python@v5
if: ${{ matrix.os == 'windows-latest' }}
with:
python-version: '3.12'
architecture: x86


- name: Install and test
shell: bash
run: |
pip install .
pip install -e .
pip install -r requirements/test.txt
pytest tests/ --cov=whenever
pytest tests/
Test-pure-python-implementation:
test-pure-python:
name: Test pure Python version
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13-dev",
# NOTE: pypy/pytest fails sometimes (https://github.com/pypy/pypy/issues/3959)
"pypy3.9",
"pypy3.10"
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ matrix.python-version }}
# only run coverage once
- if: ${{ matrix.python-version == '3.12' }}
run: |
pip install .
pip install -r requirements/test.txt
pytest tests/ --cov=whenever --cov-report=xml
env:
WHENEVER_NO_BUILD_RUST_EXT: "1"
- run: |
pip install .
pip install -r requirements/test.txt
Expand All @@ -74,6 +120,7 @@ jobs:
with:
python-version: '3.12'
- run: |
pip install .
pip install -U pip
pip install -r requirements/lint.txt
make ci-lint
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- rust # TODO: remove
tags:
- '*'
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ci-lint: check-readme
black --check pysrc/ tests/
isort --check pysrc/ tests/
cargo fmt -- --check
python -m slotscheck pysrc/
env PYTHONPATH=pysrc/ slotscheck pysrc
cargo clippy -- -D warnings

.PHONY: clean
Expand Down
Loading

0 comments on commit c1db824

Please sign in to comment.