Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ else
fi

# List the packages.
uv sync ${UV_ARGS} --reinstall
uv sync ${UV_ARGS} --reinstall --quiet
uv pip list

# Ensure we go back to base environment after the test.
trap "uv sync" EXIT HUP

# Start the test runner.
uv run ${UV_ARGS} .evergreen/scripts/run_tests.py "$@"

Expand Down
26 changes: 15 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set shell := ["bash", "-c"]

# Commonly used command segments.
uv_run := "uv run --isolated --frozen "
uv_run := "uv run --frozen "
typing_run := uv_run + "--group typing --extra aws --extra encryption --extra ocsp --extra snappy --extra test --extra zstd"
docs_run := uv_run + "--extra docs"
doc_build := "./doc/_build"
Expand All @@ -13,51 +13,55 @@ mypy_args := "--install-types --non-interactive"
default:
@just --list

[private]
resync:
@uv sync --quiet --frozen

install:
bash .evergreen/scripts/setup-dev-env.sh

[group('docs')]
docs:
docs: && resync
{{docs_run}} sphinx-build -W -b html doc {{doc_build}}/html

[group('docs')]
docs-serve:
docs-serve: && resync
{{docs_run}} sphinx-autobuild -W -b html doc --watch ./pymongo --watch ./bson --watch ./gridfs {{doc_build}}/serve

[group('docs')]
docs-linkcheck:
docs-linkcheck: && resync
{{docs_run}} sphinx-build -E -b linkcheck doc {{doc_build}}/linkcheck

[group('typing')]
typing:
typing: && resync
just typing-mypy
just typing-pyright

[group('typing')]
typing-mypy:
typing-mypy: && resync
{{typing_run}} mypy {{mypy_args}} bson gridfs tools pymongo
{{typing_run}} mypy {{mypy_args}} --config-file mypy_test.ini test
{{typing_run}} mypy {{mypy_args}} test/test_typing.py test/test_typing_strict.py

[group('typing')]
typing-pyright:
typing-pyright: && resync
{{typing_run}} pyright test/test_typing.py test/test_typing_strict.py
{{typing_run}} pyright -p strict_pyrightconfig.json test/test_typing_strict.py

[group('lint')]
lint:
lint: && resync
{{uv_run}} pre-commit run --all-files

[group('lint')]
lint-manual:
lint-manual: && resync
{{uv_run}} pre-commit run --all-files --hook-stage manual

[group('test')]
test *args="-v --durations=5 --maxfail=10":
test *args="-v --durations=5 --maxfail=10": && resync
{{uv_run}} --extra test pytest {{args}}

[group('test')]
run-tests *args:
run-tests *args: && resync
bash ./.evergreen/run-tests.sh {{args}}

[group('test')]
Expand Down
Loading