@@ -16,64 +16,78 @@ default:
1616resync :
1717 @ uv sync --quiet
1818
19+ # Set up the development environment
1920install :
2021 bash .evergreen/ scripts/ setup-dev-env .sh
2122
23+ # Build the HTML documentation
2224[group (' docs' )]
2325docs : && resync
2426 {{ docs_run}} sphinx-build -W -b html doc {{ doc_build}} / html
2527
28+ # Serve the docs locally with live-reload
2629[group (' docs' )]
2730docs-serve : && resync
2831 {{ docs_run}} sphinx-autobuild -W -b html doc --watch ./ pymongo --watch ./ bson --watch ./ gridfs {{ doc_build}} / serve
2932
33+ # Check documentation hyperlinks for broken URLs
3034[group (' docs' )]
3135docs-linkcheck : && resync
3236 {{ docs_run}} sphinx-build -E -b linkcheck doc {{ doc_build}} / linkcheck
3337
38+ # Run mypy and pyright
3439[group (' typing' )]
3540typing : && resync
3641 just typing-mypy
3742 just typing-pyright
3843
44+ # Run mypy against the library source and test suite
3945[group (' typing' )]
4046typing-mypy : && resync
4147 {{ typing_run}} python -m mypy {{ mypy_args}} bson gridfs tools pymongo
4248 {{ typing_run}} python -m mypy {{ mypy_args}} --config-file mypy_test.ini test
4349 {{ typing_run}} python -m mypy {{ mypy_args}} test/ test_typing.py test/ test_typing_strict.py
4450
51+ # Run pyright against the typing test files
4552[group (' typing' )]
4653typing-pyright : && resync
4754 {{ typing_run}} python -m pyright test/ test_typing.py test/ test_typing_strict.py
4855 {{ typing_run}} python -m pyright -p strict_pyrightconfig.json test/ test_typing_strict.py
4956
57+ # Run all pre-commit hooks across the repository
5058[group (' lint' )]
5159lint * args = " ": && resync
5260 uvx pre-commit run --all-files {{ args}}
5361
62+ # Run shellcheck, doc8, and slotscheck
5463[group (' lint' )]
5564lint-manual * args = " ": && resync
5665 uvx pre-commit run --all-files --hook-stage manual {{ args}}
5766
67+ # Run pytest (e.g. just test test/test_uri_parser.py)
5868[group (' test' )]
5969test * args = " -v --durations=5 --maxfail=10": && resync
6070 #!/usr/bin/env bash
6171 set -euo pipefail
6272 uv run ${USE_ACTIVE_VENV:+ --active} --extra test python -m pytest {{ args}}
6373
74+ # Run the BSON test suite with numpy
6475[group (' test' )]
6576test-numpy * args = " ": && resync
6677 just setup-tests numpy {{ args}}
6778 just run-tests test/ test_bson.py
6879
80+ # Run tests via the Evergreen test runner script
6981[group (' test' )]
7082run-tests * args : && resync
7183 bash ./ .evergreen/ run-tests.sh {{ args}}
7284
85+ # Set up the test environment (auth, TLS, etc.)
7386[group (' test' )]
7487setup-tests * args = " ":
7588 bash .evergreen/ scripts/ setup-tests.sh {{ args}}
7689
90+ # Tear down resources created by setup-tests
7791[group (' test' )]
7892teardown-tests :
7993 bash .evergreen/ scripts/ teardown-tests.sh
@@ -82,25 +96,30 @@ teardown-tests:
8296integration-tests :
8397 bash integration_tests/ run.sh
8498
99+ # Run the full test suite with coverage
85100[group (' test' )]
86101test-coverage * args = " ":
87102 just setup-tests --cov
88103 just run-tests {{ args}}
89104
105+ # Print the coverage summary to the terminal
90106[group (' coverage' )]
91107coverage-report :
92108 uv tool run --with " coverage[toml]" coverage report
93109
110+ # Generate an HTML coverage report in htmlcov/
94111[group (' coverage' )]
95112coverage-html :
96113 uv tool run --with " coverage[toml]" coverage html
97114 @ echo " Coverage report generated in htmlcov/index.html"
98115
116+ # Generate an XML coverage report at coverage.xml
99117[group (' coverage' )]
100118coverage-xml :
101119 uv tool run --with " coverage[toml]" coverage xml
102120 @ echo " Coverage report generated in coverage.xml"
103121
122+ # Start a MongoDB server via drivers-evergreen-tools
104123[group (' server' )]
105124run-server * args = " ":
106125 bash .evergreen/ scripts/ run-server.sh {{ args}}
0 commit comments