33
44PYTHON_VERSION ?= 3.10
55IMAGE = testcontainers-python:${PYTHON_VERSION}
6- PACKAGES = core $(addprefix modules/,$(notdir $(wildcard modules/* ) ) )
76
8- UPLOAD = $(addsuffix /upload,${PACKAGES})
9- TESTS = $(addsuffix /tests,$(filter-out meta,${PACKAGES}) )
10- TESTS_DIND = $(addsuffix -dind,${TESTS})
11- DOCTESTS = $(addsuffix /doctests,$(filter-out modules/README.md,${PACKAGES}) )
7+ COMMUNITY_MODULES = $(patsubst tests/community/% /,% ,$(wildcard tests/community/* /) )
8+ COMMUNITY_TESTS = $(addprefix community/,$(addsuffix /tests,$(COMMUNITY_MODULES ) ) )
9+ COMMUNITY_DOCTESTS = $(addprefix community/,$(addsuffix /doctests,$(COMMUNITY_MODULES ) ) )
1210
1311
1412install : # # Set up the project for development
@@ -18,15 +16,17 @@ install: ## Set up the project for development
1816build : # # Build the python package
1917 uv build && uv run twine check dist/*
2018
21- tests : ${TESTS} # # Run tests for each package
22- ${TESTS} : % /tests:
23- uv run coverage run --parallel -m pytest -v $* /tests
19+ tests : core/tests community-tests # # Run all tests
2420
25- quick-core-tests : # # Run core tests excluding long_running
26- uv run coverage run --parallel -m pytest -v -m " not long_running" core/tests
21+ core/tests : # # Run tests for the core package
22+ uv run coverage run --parallel -m pytest -v tests/core
23+
24+ community-tests : $(COMMUNITY_TESTS ) # # Run tests for all community modules
25+ $(COMMUNITY_TESTS ) : community/% /tests:
26+ uv run coverage run --parallel -m pytest -v tests/community/$*
2727
28- core-tests : # # Run tests for the core package
29- uv run coverage run --parallel -m pytest -v core/ tests
28+ quick- core-tests : # # Run core tests excluding long_running
29+ uv run coverage run --parallel -m pytest -v -m " not long_running " tests/core
3030
3131coverage : # # Target to combine and report coverage.
3232 uv run coverage combine
@@ -37,24 +37,21 @@ coverage: ## Target to combine and report coverage.
3737lint : # # Lint all files in the project, which we also run in pre-commit
3838 uv run pre-commit run --all-files
3939
40- mypy-core : # # Run mypy on the core package
41- uv run mypy --config-file pyproject.toml core
42-
43- mypy-core-report : # # Generate a report for mypy on the core package
44- uv run mypy --config-file pyproject.toml core | uv run python scripts/mypy_report.py
45-
4640docs : # # Build the docs for the project
4741 uv run --all-extras sphinx-build -nW docs docs/_build
4842
4943# Target to build docs watching for changes as per https://stackoverflow.com/a/21389615
50- docs-watch :
44+ docs-watch :
5145 uv run sphinx-autobuild docs docs/_build # requires 'pip install sphinx-autobuild'
5246
53- doctests : ${DOCTESTS} # # Run doctests found across the documentation.
54- uv run --all-extras sphinx-build -b doctest . docs/_build
47+ doctests : core/doctests community-doctests # # Run doctests found across the documentation.
48+
49+ core/doctests : # # Run doctests for the core package
50+ uv run --all-extras sphinx-build -b doctest -c doctests docs/core docs/_build
5551
56- ${DOCTESTS} : % /doctests: # # Run doctests found for a module.
57- uv run --all-extras sphinx-build -b doctest -c doctests $* docs/_build
52+ community-doctests : $(COMMUNITY_DOCTESTS ) # # Run doctests for all community modules
53+ $(COMMUNITY_DOCTESTS ) : community/% /doctests:
54+ uv run --all-extras sphinx-build -b doctest docs docs/_build docs/community/$* .rst
5855
5956
6057clean : # # Remove generated files.
@@ -67,7 +64,9 @@ clean-all: clean ## Remove all generated files and reset the local virtual envir
6764 rm -rf .venv
6865
6966# Targets that do not generate file-level artifacts.
70- .PHONY : clean docs doctests image tests quick-core-tests ${TESTS}
67+ .PHONY : clean docs doctests core/doctests community-doctests $(COMMUNITY_DOCTESTS ) \
68+ tests core/tests community-tests $(COMMUNITY_TESTS) \
69+ quick-core-tests install build coverage lint mypy-core mypy-core-report docs-watch
7170
7271
7372# Implements this pattern for autodocumenting Makefiles:
0 commit comments