Skip to content

Commit

Permalink
#116: Add mypy to CI pipeline and to default tox environments
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryDiv committed Apr 30, 2024
1 parent f7dd402 commit ac853ce
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Run unit tests with tox
# Run tox using the version of Python in `PATH`
run: tox run -e clean,py,flake8,report -- --junit-xml=reports/pytest_${{ matrix.python-version }}.xml
run: tox run -e clean,py,report,flake8,mypy -- --junit-xml=reports/pytest_${{ matrix.python-version }}.xml

- name: Upload test result artifacts
uses: actions/upload-artifact@v3
Expand Down
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ build:
# Test suite
# ----------

# Run complete tox suite
# Run complete tox suite with local Python interpreter
.PHONY: tox
tox:
tox run
Expand All @@ -37,7 +37,7 @@ venv-tox:
# Only run pytest
.PHONY: test
test:
tox run --skip-env flake8,mypy
tox run -e clean,py,report

# Only run flake8 linter
.PHONY: flake8
Expand Down Expand Up @@ -67,25 +67,25 @@ docker-tox:

# Run partial tox test suites in Docker
.PHONY: docker-tox-py312 docker-tox-py311 docker-tox-py310 docker-tox-py39 docker-tox-py38
docker-tox-py312: TOX_ARGS="-e clean,py312,py312-report"
docker-tox-py312: docker-tox
docker-tox-py311: TOX_ARGS="-e clean,py311,py311-report"
docker-tox-py311: docker-tox
docker-tox-py310: TOX_ARGS="-e clean,py310,py310-report"
docker-tox-py310: docker-tox
docker-tox-py39: TOX_ARGS="-e clean,py39,py39-report"
docker-tox-py39: docker-tox
docker-tox-py38: TOX_ARGS="-e clean,py38,py38-report"
docker-tox-py38: docker-tox
docker-test-py312: TOX_ARGS="-e clean,py312,py312-report"
docker-test-py312: docker-tox
docker-test-py311: TOX_ARGS="-e clean,py311,py311-report"
docker-test-py311: docker-tox
docker-test-py310: TOX_ARGS="-e clean,py310,py310-report"
docker-test-py310: docker-tox
docker-test-py39: TOX_ARGS="-e clean,py39,py39-report"
docker-test-py39: docker-tox
docker-test-py38: TOX_ARGS="-e clean,py38,py38-report"
docker-test-py38: docker-tox

# Run all tox test suites, but separately to check code coverage individually
.PHONY: docker-tox-all
docker-tox-all:
make docker-tox-py38
make docker-tox-py39
make docker-tox-py310
make docker-tox-py311
make docker-tox-py312
docker-test-all:
make docker-test-py38
make docker-test-py39
make docker-test-py310
make docker-test-py311
make docker-test-py312

# Run mypy using all different (or specific) Python versions in Docker
.PHONY: docker-mypy-all docker-mypy-py312 docker-mypy-py311 docker-mypy-py310 docker-mypy-py39 docker-mypy-py38
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[tox]
minversion = 4.5.1
# TODO: Add mypy to the default environments when all issues are fixed.
envlist = clean,py{312,311,310,39,38},flake8,report
envlist = clean,py{312,311,310,39,38},report,flake8,mypy
skip_missing_interpreters = true
isolated_build = true

Expand Down

0 comments on commit ac853ce

Please sign in to comment.