From 50976bbc33e58bba294c571bdec8680898b31870 Mon Sep 17 00:00:00 2001 From: Markus Grotz Date: Fri, 3 Apr 2026 13:19:49 +0200 Subject: [PATCH] switch to uv build system. Closes #30. --- README.md | 21 ++++++++++++--------- pyproject.toml | 8 ++++---- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d2a6a6e..dc15593 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,17 @@ Limitations: ## Installation ``` +uv add mjpl +# or pip install mjpl ``` ## Development -For local development, clone the repository and install the developer dependencies: +This project uses [uv](https://docs.astral.sh/uv/) for dependency management and builds. +For local development, clone the repository and sync the developer dependencies: ``` -pip install -e ".[dev]" +uv sync --extra dev ``` This project uses [Ruff](https://docs.astral.sh/ruff/) for linting and formatting. @@ -38,28 +41,28 @@ Unit tests are written via the [unittest](https://docs.python.org/3/library/unit To run the linter, formatter, and tests locally: ```bash # Check for linter errors -ruff check . +uv run ruff check . # Apply lint fixes -ruff check --fix . +uv run ruff check --fix . # Check for format errors -ruff format --diff . +uv run ruff format --diff . # Apply format fixes -ruff format . +uv run ruff format . # Run unit tests -python3 -m unittest -v +uv run python -m unittest -v ``` [Pre-commit](https://pre-commit.com/) hooks are also available which run the linter, formatter, and unit tests. To trigger the hooks automatically on commit, install the pre-commit hooks: ``` -pre-commit install +uv run pre-commit install ``` To trigger the hooks manually: ``` -pre-commit run --all-files +uv run pre-commit run --all-files ``` To bypass installed pre-commit hooks on commit: diff --git a/pyproject.toml b/pyproject.toml index d49ff92..8ed9731 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,3 @@ -[build-system] -requires = ["hatchling >= 1.27"] -build-backend = "hatchling.build" - [project] name = "mjpl" version = "0.0.1" @@ -53,6 +49,10 @@ dev = [ [project.urls] Homepage = "https://github.com/adlarkin/mjpl" +[build-system] +requires = ["uv_build>=0.9.4,<0.10.0"] +build-backend = "uv_build" + [tool.ruff] target-version = "py310"