Skip to content

Commit

Permalink
feat: switch to tox for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Dec 28, 2023
1 parent 4ed0003 commit 42919d2
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 20 deletions.
43 changes: 30 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,36 @@ jobs:
- name: Run tests
run: |
cmake --build build --target check
pytest:
runs-on: ubuntu-latest
python-tests:
name: test with ${{ matrix.py }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
py:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
run: |
sudo apt-get install sox
python -m pip install --upgrade pip
pip install -r requirements.dev.txt
pip install .
- name: Run tests
run: pytest
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Install tox
run: python -m pip install tox-gh>=1.2
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
run: tox --skip-pkg-install
pytest-editable:
runs-on: ubuntu-latest
steps:
Expand All @@ -55,7 +72,7 @@ jobs:
run: |
sudo apt-get install sox
python -m pip install --upgrade pip
pip install -r requirements.dev.txt
pip install pytest memory_profiler
pip install -e .
- name: Run tests
run: pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ CTestTestfile.cmake
DartConfiguration.tcl
cmake_install.cmake

.tox
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"

sphinx:
configuration: docs/source/conf.py
Expand Down
6 changes: 0 additions & 6 deletions requirements.dev.txt

This file was deleted.

21 changes: 21 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tox]
env_list = py{38,39,310,311,312}
minversion = 4.11.4

[testenv]
description = run the tests with pytest
package = wheel
wheel_build_env = .pkg
deps =
pytest>=6
memory_profiler
commands =
pytest {tty:--color=yes} {posargs}

[gh]
python =
3.12 = py312
3.11 = py311
3.10 = py310
3.9 = py39
3.8 = py38

0 comments on commit 42919d2

Please sign in to comment.