Skip to content

Commit 78147b3

Browse files
committed
fix: add tests to package deps
1 parent 96f3a73 commit 78147b3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ PACKAGE_NAME := package
88
PACKAGE_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
176177
test: 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
231232
dist-clean:
232233
rm -fr dist/*
234+
rm -f .venv/checked-on .venv/tested-on
233235
rm -f requirements.txt
234236
clean: dist-clean
235237
rm -fr .coverage .hypothesis/ .mypy_cache/ .pytest_cache/

0 commit comments

Comments
 (0)