From 3da4e3874ab03612cf82187a028e5bd4187800d0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jul 2024 20:38:38 -0500 Subject: [PATCH] make sure installed version passes test too --- .github/workflows/test.yml | 5 ++++- Makefile | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f58dc8..ada2d01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,9 +67,12 @@ jobs: if: (! startsWith(matrix.python-version, 'pypy-')) run: make mypy PYTHON=python - - name: Test + - name: Coverage run: make coverage PYTHON=python + - name: Test installed version + run: make test_venv PYTHON=python + - name: Upload Coverage as artifact if: always() uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index 4a9f3f8..05f5f1c 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,11 @@ STEPECHO = @echo endif PYTHON ?= python3 +ifeq ($(OS),Windows_NT) +ENVPYTHON ?= _env/Scripts/python.exe +else +ENVPYTHON ?= _env/bin/python3 +endif .PHONY: default default: coverage mypy @@ -31,6 +36,12 @@ coverage: $(Q)$(PYTHON) -mcoverage xml $(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 mypy: $(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). .PHONY: html html: - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + $(Q)$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) # SPDX-FileCopyrightText: 2024 Jeff Epler #