Skip to content

Commit

Permalink
justfile now completely depends on uv.
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverandrich committed Nov 17, 2024
1 parent f5113de commit c9b3895
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,39 @@ VENV_DIRNAME := ".venv"
@_default:
just --list

[private]
@check_uv:
if ! command -v uv &> /dev/null; then \
echo "uv could not be found. Exiting."; \
exit; \
fi

# setup development environment
@bootstrap:
@bootstrap: check_uv
if [ -x $VENV_DIRNAME ]; then \
echo "Already bootstraped. Exiting."; \
exit; \
fi

echo "Creating virtual env in .venv"
just create_venv

echo "Installing dependencies"
just upgrade

# create a virtual environment
@create_venv:
[ -d $VENV_DIRNAME ] || uv venv $VENV_DIRNAME

# build release
@build:
uv build

# publish release
@publish: build
uv publish

# upgrade/install all dependencies defined in pyproject.toml
@upgrade: create_venv
uv sync --all-extras
@upgrade: check_uv
uv sync --all-extras --upgrade

# run pre-commit rules on all files
@lint: create_venv
@lint: check_uv
uvx --with pre-commit-uv pre-commit run --all-files

# run test suite
@test: create_venv
@test: check_uv
uv run pytest --cov --cov-report=html --cov-report=term

# run test suite
@test-all: create_venv
@test-all: check_uv
uvx --with tox-uv tox

# serve docs during development
@serve-docs:
@serve-docs: check_uv
uvx --with mkdocs-material mkdocs serve

0 comments on commit c9b3895

Please sign in to comment.