From 56a19851df298053cc1501afcff234888b765229 Mon Sep 17 00:00:00 2001 From: Fernando Macedo Date: Tue, 12 Nov 2024 15:31:57 -0300 Subject: [PATCH] chore: Fix pre-commit and update docs references for Poetry to UV (#492) * chore: Fix pre-commit and update docs references for Poetry to UV * chore: Using release version of Python3.13 in build matrix --- .github/workflows/python-package.yml | 2 +- .pre-commit-config.yaml | 4 ++-- docs/contributing.md | 24 +++++++++++------------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4b22ff74..8531f645 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.1"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0"] steps: - uses: actions/checkout@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e0eca00a..8b8426f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,13 +21,13 @@ repos: hooks: - id: mypy name: Mypy - entry: poetry run mypy --namespace-packages --explicit-package-bases statemachine/ tests/ + entry: uv run mypy --namespace-packages --explicit-package-bases statemachine/ tests/ types: [python] language: system pass_filenames: false - id: pytest name: Pytest - entry: poetry run pytest + entry: uv run pytest types: [python] language: system pass_filenames: false diff --git a/docs/contributing.md b/docs/contributing.md index ce4b4554..079345e3 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -87,7 +87,7 @@ Ready to contribute? Here's how to set up `python-statemachine` for local develo 1. Install dependencies. 1. [graphviz](https://graphviz.org/download/#linux) - 1. [poetry](https://python-poetry.org/docs/#installation) + 1. [uv](https://docs.astral.sh/uv/getting-started/installation/) 1. Fork the `python-statemachine` repository on GitHub. @@ -96,31 +96,29 @@ Ready to contribute? Here's how to set up `python-statemachine` for local develo git clone https://github.com/YOUR-USERNAME/python-statemachine.git. -1. Run `poetry install` once to install all the dependencies and create a virtual environment:: +1. Run `uv sync` once to install all the development dependencies and create a virtual environment:: - poetry install --all-extras + uv sync --all-extras -1. Run `poetry shell` to enter the provided virtual - -1. Install the pre-commit validations: +2. Install the pre-commit validations: pre-commit install -1. Create a branch for local development: +3. Create a branch for local development: git checkout -b -1. Make changes to the code. +4. Make changes to the code. -1. Run tests to ensure they pass by running: +5. Run tests to ensure they pass by running: - poetry run pytest + uv run pytest -1. Update the documentation as needed. +6. Update the documentation as needed. Build the documentation: - poetry run sphinx-build docs docs/_build/html + uv run sphinx-build docs docs/_build/html Now you can serve the local documentation using a webserver, like the built-in included @@ -133,7 +131,7 @@ Ready to contribute? Here's how to set up `python-statemachine` for local develo If you're specially writting documentation, I strongly recommend using `sphinx-autobuild` as it improves the workflow watching for file changes and with live reloading: - poetry run sphinx-autobuild docs docs/_build/html --re-ignore "auto_examples/.*" + uv run sphinx-autobuild docs docs/_build/html --re-ignore "auto_examples/.*" Sometimes you need a full fresh of the files being build for docs, you can safely remove all automatically generated files to get a clean state by running: