PYTHON-5776 Add documentation comments to justfile recipes (#2784)
This commit is contained in:
parent
64edd22d73
commit
e67931dff7
19
justfile
19
justfile
@ -16,64 +16,78 @@ default:
|
|||||||
resync:
|
resync:
|
||||||
@uv sync --quiet
|
@uv sync --quiet
|
||||||
|
|
||||||
|
# Set up the development environment
|
||||||
install:
|
install:
|
||||||
bash .evergreen/scripts/setup-dev-env.sh
|
bash .evergreen/scripts/setup-dev-env.sh
|
||||||
|
|
||||||
|
# Build the HTML documentation
|
||||||
[group('docs')]
|
[group('docs')]
|
||||||
docs: && resync
|
docs: && resync
|
||||||
{{docs_run}} sphinx-build -W -b html doc {{doc_build}}/html
|
{{docs_run}} sphinx-build -W -b html doc {{doc_build}}/html
|
||||||
|
|
||||||
|
# Serve the docs locally with live-reload
|
||||||
[group('docs')]
|
[group('docs')]
|
||||||
docs-serve: && resync
|
docs-serve: && resync
|
||||||
{{docs_run}} sphinx-autobuild -W -b html doc --watch ./pymongo --watch ./bson --watch ./gridfs {{doc_build}}/serve
|
{{docs_run}} sphinx-autobuild -W -b html doc --watch ./pymongo --watch ./bson --watch ./gridfs {{doc_build}}/serve
|
||||||
|
|
||||||
|
# Check documentation hyperlinks for broken URLs
|
||||||
[group('docs')]
|
[group('docs')]
|
||||||
docs-linkcheck: && resync
|
docs-linkcheck: && resync
|
||||||
{{docs_run}} sphinx-build -E -b linkcheck doc {{doc_build}}/linkcheck
|
{{docs_run}} sphinx-build -E -b linkcheck doc {{doc_build}}/linkcheck
|
||||||
|
|
||||||
|
# Run mypy and pyright
|
||||||
[group('typing')]
|
[group('typing')]
|
||||||
typing: && resync
|
typing: && resync
|
||||||
just typing-mypy
|
just typing-mypy
|
||||||
just typing-pyright
|
just typing-pyright
|
||||||
|
|
||||||
|
# Run mypy against the library source and test suite
|
||||||
[group('typing')]
|
[group('typing')]
|
||||||
typing-mypy: && resync
|
typing-mypy: && resync
|
||||||
{{typing_run}} python -m mypy {{mypy_args}} bson gridfs tools pymongo
|
{{typing_run}} python -m mypy {{mypy_args}} bson gridfs tools pymongo
|
||||||
{{typing_run}} python -m mypy {{mypy_args}} --config-file mypy_test.ini test
|
{{typing_run}} python -m mypy {{mypy_args}} --config-file mypy_test.ini test
|
||||||
{{typing_run}} python -m mypy {{mypy_args}} test/test_typing.py test/test_typing_strict.py
|
{{typing_run}} python -m mypy {{mypy_args}} test/test_typing.py test/test_typing_strict.py
|
||||||
|
|
||||||
|
# Run pyright against the typing test files
|
||||||
[group('typing')]
|
[group('typing')]
|
||||||
typing-pyright: && resync
|
typing-pyright: && resync
|
||||||
{{typing_run}} python -m pyright test/test_typing.py test/test_typing_strict.py
|
{{typing_run}} python -m pyright test/test_typing.py test/test_typing_strict.py
|
||||||
{{typing_run}} python -m pyright -p strict_pyrightconfig.json test/test_typing_strict.py
|
{{typing_run}} python -m pyright -p strict_pyrightconfig.json test/test_typing_strict.py
|
||||||
|
|
||||||
|
# Run all pre-commit hooks across the repository
|
||||||
[group('lint')]
|
[group('lint')]
|
||||||
lint *args="": && resync
|
lint *args="": && resync
|
||||||
uvx pre-commit run --all-files {{args}}
|
uvx pre-commit run --all-files {{args}}
|
||||||
|
|
||||||
|
# Run shellcheck, doc8, and slotscheck
|
||||||
[group('lint')]
|
[group('lint')]
|
||||||
lint-manual *args="": && resync
|
lint-manual *args="": && resync
|
||||||
uvx pre-commit run --all-files --hook-stage manual {{args}}
|
uvx pre-commit run --all-files --hook-stage manual {{args}}
|
||||||
|
|
||||||
|
# Run pytest (e.g. just test test/test_uri_parser.py)
|
||||||
[group('test')]
|
[group('test')]
|
||||||
test *args="-v --durations=5 --maxfail=10": && resync
|
test *args="-v --durations=5 --maxfail=10": && resync
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
uv run ${USE_ACTIVE_VENV:+--active} --extra test python -m pytest {{args}}
|
uv run ${USE_ACTIVE_VENV:+--active} --extra test python -m pytest {{args}}
|
||||||
|
|
||||||
|
# Run the BSON test suite with numpy
|
||||||
[group('test')]
|
[group('test')]
|
||||||
test-numpy *args="": && resync
|
test-numpy *args="": && resync
|
||||||
just setup-tests numpy {{args}}
|
just setup-tests numpy {{args}}
|
||||||
just run-tests test/test_bson.py
|
just run-tests test/test_bson.py
|
||||||
|
|
||||||
|
# Run tests via the Evergreen test runner script
|
||||||
[group('test')]
|
[group('test')]
|
||||||
run-tests *args: && resync
|
run-tests *args: && resync
|
||||||
bash ./.evergreen/run-tests.sh {{args}}
|
bash ./.evergreen/run-tests.sh {{args}}
|
||||||
|
|
||||||
|
# Set up the test environment (auth, TLS, etc.)
|
||||||
[group('test')]
|
[group('test')]
|
||||||
setup-tests *args="":
|
setup-tests *args="":
|
||||||
bash .evergreen/scripts/setup-tests.sh {{args}}
|
bash .evergreen/scripts/setup-tests.sh {{args}}
|
||||||
|
|
||||||
|
# Tear down resources created by setup-tests
|
||||||
[group('test')]
|
[group('test')]
|
||||||
teardown-tests:
|
teardown-tests:
|
||||||
bash .evergreen/scripts/teardown-tests.sh
|
bash .evergreen/scripts/teardown-tests.sh
|
||||||
@ -82,25 +96,30 @@ teardown-tests:
|
|||||||
integration-tests:
|
integration-tests:
|
||||||
bash integration_tests/run.sh
|
bash integration_tests/run.sh
|
||||||
|
|
||||||
|
# Run the full test suite with coverage
|
||||||
[group('test')]
|
[group('test')]
|
||||||
test-coverage *args="":
|
test-coverage *args="":
|
||||||
just setup-tests --cov
|
just setup-tests --cov
|
||||||
just run-tests {{args}}
|
just run-tests {{args}}
|
||||||
|
|
||||||
|
# Print the coverage summary to the terminal
|
||||||
[group('coverage')]
|
[group('coverage')]
|
||||||
coverage-report:
|
coverage-report:
|
||||||
uv tool run --with "coverage[toml]" coverage report
|
uv tool run --with "coverage[toml]" coverage report
|
||||||
|
|
||||||
|
# Generate an HTML coverage report in htmlcov/
|
||||||
[group('coverage')]
|
[group('coverage')]
|
||||||
coverage-html:
|
coverage-html:
|
||||||
uv tool run --with "coverage[toml]" coverage html
|
uv tool run --with "coverage[toml]" coverage html
|
||||||
@echo "Coverage report generated in htmlcov/index.html"
|
@echo "Coverage report generated in htmlcov/index.html"
|
||||||
|
|
||||||
|
# Generate an XML coverage report at coverage.xml
|
||||||
[group('coverage')]
|
[group('coverage')]
|
||||||
coverage-xml:
|
coverage-xml:
|
||||||
uv tool run --with "coverage[toml]" coverage xml
|
uv tool run --with "coverage[toml]" coverage xml
|
||||||
@echo "Coverage report generated in coverage.xml"
|
@echo "Coverage report generated in coverage.xml"
|
||||||
|
|
||||||
|
# Start a MongoDB server via drivers-evergreen-tools
|
||||||
[group('server')]
|
[group('server')]
|
||||||
run-server *args="":
|
run-server *args="":
|
||||||
bash .evergreen/scripts/run-server.sh {{args}}
|
bash .evergreen/scripts/run-server.sh {{args}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user