Skip to content

Commit

Permalink
Merge pull request #183 from pytest-dev/tox-4
Browse files Browse the repository at this point in the history
Upgrade to tox 4
  • Loading branch information
youtux committed Dec 11, 2022
2 parents 0d78c9b + 393c95b commit e64af69
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 81 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,31 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

include:
- python-version: "3.7"
toxfactor: py37
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.8"
toxfactor: py38
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.9"
toxfactor: py39
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.10"
toxfactor: py310
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.11"
toxfactor: py311
ignore-typecheck-outcome: true
ignore-test-outcome: false
- python-version: "3.12.0-alpha.3"
toxfactor: py312
ignore-typecheck-outcome: true
ignore-test-outcome: true
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -22,18 +45,17 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -U setuptools
pip install tox tox-gh-actions coverage[toml]
pip install "tox~=4.0" coverage[toml]
- name: Type checking
# Ignore errors for older pythons
continue-on-error: ${{ contains(fromJSON('["3.7", "3.8", "3.9"]'), matrix.python-version)}}
continue-on-error: ${{ matrix.ignore-typecheck-outcome }}
run: |
tox -e mypy
- name: Test with tox
env:
TOX_PARALLEL_NO_SPINNER: 1
continue-on-error: ${{ matrix.ignore-test-outcome }}
run: |
coverage erase
tox --parallel
tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live
coverage combine
coverage xml
- uses: codecov/codecov-action@v3
Expand Down
125 changes: 71 additions & 54 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ classifiers = [
"pytest-factoryboy" = "pytest_factoryboy.plugin"

[tool.poetry.dependencies]
python = ">=3.7"
python = "~=3.7"
inflection = "*"
factory_boy = ">=2.10.0"
pytest = ">=5.0.0"
typing_extensions = "*"

[tool.poetry.group.dev.dependencies]
mypy = "^0.991"
tox = "^3.27.0"
packaging = "^21.3"
tox = "^4.0.8"
packaging = "^22.0"
importlib-metadata = { version = "^5.0.0", python = "<3.8" }
coverage = {extras = ["toml"], version = "^6.5.0"}

Expand Down
21 changes: 4 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
# Needed for setup.py-less installs
isolated_build = True
distshare = {homedir}/.tox/distshare
envlist = py{37,38,39}-pytest{50,51,52,53,54,60,61,62,70,71,72,latest,main},
py{310,311}-pytest{62,70,71,latest,main},
envlist = py{37,38,39}-pytest{50,51,52,53,54,60,61,62,70,71,72,latest,main}
py{310,311,312}-pytest{62,70,71,latest,main}
mypy


[testenv]
parallel_show_output = true
Expand All @@ -25,10 +25,6 @@ deps =

coverage[toml]

[testenv:py312-pytestlatest]
# allow failures of tests run with unstable python 3.12
ignore_outcome = true

[testenv:mypy]
commands = mypy {posargs:.}
deps =
Expand All @@ -37,12 +33,3 @@ deps =

[pytest]
addopts = -vv -l


[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311

0 comments on commit e64af69

Please sign in to comment.