Skip to content

Commit

Permalink
Merge pull request #61 from stuartmaxwell:justfile-updates
Browse files Browse the repository at this point in the history
Justfile-updates
  • Loading branch information
stuartmaxwell authored Nov 15, 2024
2 parents 657eadd + dac3efe commit 2a1271e
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set the default recipe to list all available commands
default:
@default:
@just --list

# Set the Python version
Expand All @@ -19,93 +19,93 @@ SOURCEDIR := "docs"
BUILDDIR := "docs/_build"

# Run the Django development server
run:
@run:
@just sync
{{uv}} example/manage.py runserver

# Make migrations
makemigrations:
@makemigrations:
{{uv}} example/manage.py makemigrations

# Apply migrations
migrate:
@migrate:
{{uv}} example/manage.py migrate

# Create a superuser
createsuperuser:
@createsuperuser:
{{uv}} example/manage.py createsuperuser

# Collect static files
collectstatic:
@collectstatic:
{{uv}} example/manage.py collectstatic

# Run Django shell
shell:
@shell:
{{uv}} example/manage.py shell

# Check for any problems in your project
check:
@check:
{{uv}} example/manage.py check

# Run pytest
test:
@test:
{{uv}} pytest

# Run Ruff linking
lint:
@lint:
{{uv-tool}} ruff check

# Run Ruff formatting
format:
@format:
{{uv-tool}} ruff format

# Run nox
nox:
@nox:
{{uv-tool}} nox --session test

# Run coverage
cov:
@cov:
{{uv}} coverage run -m pytest
{{uv}} coverage report -m

# Run coverage
cov-html:
@cov-html:
{{uv}} coverage run -m pytest
{{uv}} coverage html

# Sync the package
sync:
@sync:
uv sync --python {{python_version}} --all-extras

# Sync the package
sync-up:
@sync-up:
uv sync --python {{python_version}} --all-extras --upgrade

# Lock the package version
lock:
@lock:
uv lock

# Build the package
build:
@build:
uv build

# Publish the package - this requires a $HOME/.pypirc file with your credentials
publish:
@publish:
rm -rf ./dist/*
uv build
{{uv-tool}} twine check dist/*
{{uv-tool}} twine upload dist/*

# Upgrade pre-commit hooks
pc-up:
@pc-up:
{{uv-tool}} pre-commit autoupdate

# Run pre-commit hooks
pc-run:
@pc-run:
{{uv-tool}} pre-commit run --all-files

# Use Sphinx to build and view the documentation
docs:
@docs:
uv run sphinx-autobuild -b html "{{SOURCEDIR}}" "{{BUILDDIR}}" {{SPHINXOPTS}}

# Use BumpVer to increase the patch version number. Use just bump -d to view a dry-run.
Expand All @@ -116,3 +116,9 @@ docs:
@bump-minor *ARGS:
uv run bumpver update --minor {{ ARGS }}
uv sync

# Create a new GitHub release - this requires Python 3.11 or newer, and the GitHub CLI must be installed and configured
version := `python3 -c "from tomllib import load; print(load(open('pyproject.toml', 'rb'))['project']['version'])"`
[confirm("Create release v{{version}}?")]
@release:
gh release create "v{{version}}" --generate-notes

0 comments on commit 2a1271e

Please sign in to comment.