Skip to content

Commit

Permalink
Convert isolated tests to use Tox
Browse files Browse the repository at this point in the history
  • Loading branch information
HexDecimal committed Oct 25, 2023
1 parent 086684f commit e2c77b0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,34 +179,32 @@ jobs:
run: python -m sphinx -T -E -W --keep-going . _build/html

isolated: # Test installing the package from source.
needs: [ruff, mypy, sdist]
needs: [ruff, mypy]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ env.git-depth }}
- name: Checkout submodules
run: git submodule update --init --recursive --depth 1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
python -m pip install --upgrade pip tox
- name: Install APT dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- uses: actions/download-artifact@v3
with:
name: sdist
- name: Build package in isolation
run: |
pip install tcod-*.tar.gz
- name: Confirm package import
- name: Run tox
run: |
python -c "import tcod.context"
tox
linux-wheels:
needs: [ruff, mypy]
Expand Down
17 changes: 17 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tox]
isolated_build = True
env_list =
py311
minversion = 4.4.11

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

0 comments on commit e2c77b0

Please sign in to comment.