|
| 1 | +# ============================================================================= |
| 2 | +# β DEFAULT |
| 3 | +# ============================================================================= |
| 4 | +# If you run `just` you should get the options available, not a full install of the package |
| 5 | + |
| 6 | +default: |
| 7 | + @just --list |
| 8 | + |
| 9 | +# ============================================================================= |
| 10 | +# π CODE QUALITY & TESTING |
| 11 | +# ============================================================================= |
| 12 | +# These commands check your code quality and run tests |
| 13 | + |
| 14 | +# Run code quality tools |
| 15 | +check: |
| 16 | + echo "π Checking lock file consistency with 'pyproject.toml'" |
| 17 | + uv lock --locked |
| 18 | + echo "π Linting code: Running pre-commit" |
| 19 | + uv run pre-commit run -a |
| 20 | + echo "π Static type checking: Running mypy" |
| 21 | + uv run mypy |
| 22 | + echo "π Checking for obsolete dependencies: Running deptry" |
| 23 | + uv run deptry . |
| 24 | + |
| 25 | +# Test the code with pytest |
| 26 | +test: |
| 27 | + echo "π Testing code: Running pytest" |
| 28 | + uv run python -m pytest --doctest-modules |
| 29 | + |
| 30 | +# ============================================================================= |
| 31 | +# π DOCUMENTATION |
| 32 | +# ============================================================================= |
| 33 | +# These commands help you build and serve project documentation |
| 34 | + |
| 35 | +# Test if documentation can be built without warnings or errors |
| 36 | +docs-test: |
| 37 | + uv run mkdocs build -s |
| 38 | + |
| 39 | +# Build and serve the documentation |
| 40 | +docs: |
| 41 | + uv run mkdocs serve |
| 42 | + |
| 43 | +# ============================================================================= |
| 44 | +# π¦ BUILD & RELEASE |
| 45 | +# ============================================================================= |
| 46 | +# These commands build your package and publish it to PyPI |
| 47 | + |
| 48 | +# Clean build artifacts |
| 49 | +clean-build: |
| 50 | + echo "π Removing build artifacts" |
| 51 | + uv run python -c "import shutil; import os; shutil.rmtree('dist') if os.path.exists('dist') else None" |
| 52 | + |
| 53 | +# Build wheel file |
| 54 | +build: clean-build |
| 55 | + echo "π Creating wheel file" |
| 56 | + uvx --from build pyproject-build --installer uv |
| 57 | + |
| 58 | +# Publish a release to PyPI |
| 59 | +publish: |
| 60 | + echo "π Publishing." |
| 61 | + uvx twine upload --repository-url https://upload.pypi.org/legacy/ dist/* |
| 62 | + |
| 63 | +# Build and publish |
| 64 | +build-and-publish: build publish |
| 65 | + |
| 66 | +# ============================================================================= |
| 67 | +# ποΈ DEVELOPMENT ENVIRONMENT SETUP |
| 68 | +# ============================================================================= |
| 69 | +# These commands help you set up your development environment |
| 70 | + |
| 71 | +# Install the virtual environment and install the pre-commit hooks |
| 72 | +install: |
| 73 | + echo "π Creating virtual environment using uv" |
| 74 | + uv sync |
| 75 | + uv run pre-commit install |
0 commit comments