-
Type:
Task
-
Resolution: Fixed
-
Priority:
Unknown
-
Affects Version/s: None
-
Component/s: None
Context
We currently use hatch as our task runner, but it was not meant to be a general purpose task runner, and we have a number of bash scripts that we'd like to consolidate under a single runner. We'd explored several options, and have seen that justfile is a good option.
An example justfile that we could start with is:
# See https://just.systems/man/en/ for instructions set dotenv-filename := "./.evergreen/scripts/env.sh" # Make the default recipe private so it doesn't show up in the list. [private] default: @just --list [group('docs')] docs-build: hatch run docs:build [group('docs')] docs-serve: hatch run docs:serve [group('docs')] docs-linkcheck: hatch run docs:linkcheck [group('docs')] docs-test: hatch run doctest:test [group('typing')] typing: hatch run typing:check [group('typing')] typing-mypy: hatch run typing:mypy [group('lint')] lint: pre-commit run --all-files [group('lint')] lint-manual: pre-commit run --all-files --hook-stage manual [group('test')] test: hatch run test:test [group('test')] test-mockupdb: hatch run test:test-mockupdb [group('test')] test-eg: hatch run test:test-eg [group('encryption')] setup-encryption: bash .evergreen/setup-encryption.sh [group('encryption')] teardown-encryption: bash .evergreen/teardown-encryption.sh
We can bootstrap just as follows:
# Ensure "just" is installed. if ! command -v just > /dev/null; then # Install "just" using the installer, falling back to using cargo. echo "Installing just..." CURL_ARGS="--retry 8 --tlsv1.2 -sSf https://just.systems/install.sh" mkdir -p ${CARGO_HOME}/bin JUST_ARGS="--to ${CARGO_HOME}/bin" if [ "${OS:-}" == "Windows_NT" ]; then JUST_ARGS="$JUST_ARGS --target x86_64-pc-windows-msvc" fi curl --proto '=https' $CURL_ARGS | bash -s -- ${JUST_ARGS} || { # Install rust and install with cargo. export RUSTUP_HOME="${CARGO_HOME}/.rustup" ${DRIVERS_TOOLS}/.evergreen/install-rust.sh source "${CARGO_HOME}/env" cargo install -q just } echo "Installing just... done." fi just --version
Definition of done
Add a justfile and update documentation and script running to use it.
Pitfalls
None
- causes
-
PYTHON-5050 KMS and Other Host Failures
-
- Closed
-
- is depended on by
-
PYTHON-4976 Replace hatch with uv as our python environment and workflow tool
-
- Closed
-