From 3d16b664770dee83cb300e2f15cfd5cf932e0edb Mon Sep 17 00:00:00 2001 From: Kyle Benesch <4b796c65+github@gmail.com> Date: Wed, 25 Oct 2023 00:13:30 -0700 Subject: [PATCH] Convert isolated tests to use Tox --- .github/workflows/python-package.yml | 22 ++++++++++------------ tox.ini | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 tox.ini diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5fa48608..fdd34ead 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -178,35 +178,33 @@ jobs: working-directory: docs run: python -m sphinx -T -E -W --keep-going . _build/html - isolated: # Test installing the package from source. - needs: [ruff, mypy, sdist] + tox: + needs: [ruff] 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 --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 -vv linux-wheels: needs: [ruff, mypy] diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..4fe40298 --- /dev/null +++ b/tox.ini @@ -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}