make sure installed version passes test too

This commit is contained in:
Jeff Epler 2024-07-14 20:38:38 -05:00
parent 0e4a05cef1
commit 3da4e3874a
2 changed files with 16 additions and 2 deletions

View file

@ -67,9 +67,12 @@ jobs:
if: (! startsWith(matrix.python-version, 'pypy-')) if: (! startsWith(matrix.python-version, 'pypy-'))
run: make mypy PYTHON=python run: make mypy PYTHON=python
- name: Test - name: Coverage
run: make coverage PYTHON=python run: make coverage PYTHON=python
- name: Test installed version
run: make test_venv PYTHON=python
- name: Upload Coverage as artifact - name: Upload Coverage as artifact
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View file

@ -17,6 +17,11 @@ STEPECHO = @echo
endif endif
PYTHON ?= python3 PYTHON ?= python3
ifeq ($(OS),Windows_NT)
ENVPYTHON ?= _env/Scripts/python.exe
else
ENVPYTHON ?= _env/bin/python3
endif
.PHONY: default .PHONY: default
default: coverage mypy default: coverage mypy
@ -31,6 +36,12 @@ coverage:
$(Q)$(PYTHON) -mcoverage xml $(COVERAGE_INCLUDE) $(Q)$(PYTHON) -mcoverage xml $(COVERAGE_INCLUDE)
$(Q)$(PYTHON) -mcoverage report --fail-under=100 $(COVERAGE_INCLUDE) $(Q)$(PYTHON) -mcoverage report --fail-under=100 $(COVERAGE_INCLUDE)
.PHONY: test_venv
test_venv:
$(Q)$(PYTHON) -mvenv --clear _env
$(Q)$(ENVPYTHON) -mpip install .
$(Q)$(ENVPYTHON) -m unittest discover -s test
.PHONY: mypy .PHONY: mypy
mypy: mypy:
$(Q)mypy --strict --no-warn-unused-ignores src $(Q)mypy --strict --no-warn-unused-ignores src
@ -53,7 +64,7 @@ BUILDDIR = _build
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
.PHONY: html .PHONY: html
html: html:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) $(Q)$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# SPDX-FileCopyrightText: 2024 Jeff Epler # SPDX-FileCopyrightText: 2024 Jeff Epler
# #