File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ PACKAGE_NAME := package
88PACKAGE_VERSION := $(shell python -c $$'try: import $(PACKAGE_NAME ) ; print($(PACKAGE_NAME ) .__version__) ;\nexcept: print("unknown");')
99
1010# Files that this package depends on are in the src/ folder, so collect them
11- # all into a list.
12- PACKAGE_DEPS := $(shell find src/$(PACKAGE_NAME ) -type f -not -path "* /__pycache__/* ")
11+ # all into a list. Also collect everything needed for testing this package.
12+ PACKAGE_DEPS := $(shell find src/$(PACKAGE_NAME ) / -type f -not -path "* /__pycache__/* ")
13+ PACKAGE_DEPS_TEST := $(shell find tests/ -type f -not -path "* /__pycache__/* ")
1314
1415# This variable contains the first goal that matches any of the listed goals
1516# here, else it contains an empty string. The net effect is to filter out
@@ -174,7 +175,7 @@ check: .venv/checked-on
174175# the hook setup itself does not pass files to pytest (see .pre-commit-config.yaml).
175176.PHONY : test
176177test : check .venv/tested-on
177- .venv/tested-on : $(PACKAGE_DEPS )
178+ .venv/tested-on : $(PACKAGE_DEPS ) $( PACKAGE_DEPS_TEST )
178179 pre-commit run pytest --hook-stage push --files tests/
179180 echo " Automatically generated by Python Package Makefile on $$ (date '+%Y-%m-%d %H:%M:%S %z')." > .venv/tested-on
180181
@@ -230,6 +231,7 @@ prune:
230231.PHONY : dist-clean clean
231232dist-clean :
232233 rm -fr dist/*
234+ rm -f .venv/checked-on .venv/tested-on
233235 rm -f requirements.txt
234236clean : dist-clean
235237 rm -fr .coverage .hypothesis/ .mypy_cache/ .pytest_cache/
You can’t perform that action at this time.
0 commit comments