diff --git a/.github/workflows/ci-cd-docs.yml b/.github/workflows/ci-cd-docs.yml index dfa5e1e..b2dab6e 100644 --- a/.github/workflows/ci-cd-docs.yml +++ b/.github/workflows/ci-cd-docs.yml @@ -19,22 +19,22 @@ jobs: name: Build doc runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v5 + - uses: actions/checkout@v5 + - name: Set up Python + uses: actions/setup-python@v6 with: - python-version: '3.x' - - name: Install package with optional dependency 'doc' - run: | - python -m pip install --upgrade pip - pip install .[doc] + python-version-file: .python-version + - name: Install uv + uses: astral-sh/setup-uv@v6 + - name: Install package with extra 'doc' + run: uv sync --extra doc --dev - name: Run MkDocs build working-directory: ./docs - run: mkdocs build + run: uv run mkdocs build - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 with: - path: "docs/site/" + path: docs/site/ publish: if: success() && startsWith(github.ref, 'refs/tags') name: Publish doc diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 38d7eef..3d17ae3 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -17,24 +17,32 @@ jobs: pre-commit: name: Apply pre-commit hooks runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - '3.9' + - '3.10' + - '3.11' + - '3.12' + - '3.13' steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Python version - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: '3.x' - - name: Install extra dependencies - run: | - python -m pip install --upgrade pip - pip install .[dev,test] + python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v6 + - name: Install package with extra 'test' + run: uv sync --extra test --dev - name: Cache pre-commit hooks uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }} - name: Run pre-commit hooks - run: pre-commit run --all-files + run: uv run pre-commit run --all-files publish: needs: pre-commit if: success() && startsWith(github.ref, 'refs/tags') @@ -45,14 +53,12 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Python version - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: '3.x' + python-version-file: .python-version - name: Build package - run: | - python -m pip install --upgrade build - python -m build + run: uv build - name: Upload package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index f72e261..8580757 100644 --- a/.gitignore +++ b/.gitignore @@ -82,7 +82,7 @@ profile_default/ ipython_config.py # pyenv -.python-version +# .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. @@ -140,3 +140,6 @@ dmypy.json # OS .DS_Store + +# uv +uv.lock diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69f8f17..ce325f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,10 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-ast - - id: check-byte-order-marker + - id: fix-byte-order-marker - id: check-case-conflict - id: check-docstring-first - id: check-json @@ -25,14 +25,18 @@ repos: exclude: ^(docs/) - id: check-added-large-files args: [--maxkb=500] + - repo: https://github.com/astral-sh/uv-pre-commit + rev: 0.8.23 + hooks: + - id: uv-lock - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.1 + rev: v0.13.3 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.1 + rev: v1.18.2 hooks: - id: mypy args: [--config-file=pyproject.toml] @@ -44,7 +48,7 @@ repos: # hooks: # - id: gitleaks - repo: https://github.com/pypa/pip-audit - rev: v2.8.0 + rev: v2.9.0 hooks: - id: pip-audit args: [.] diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e2e1ac..f95769b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.10.4 - October, 2025 + +### Maintenance + +* Use [uv](https://docs.astral.sh/uv/) in CI/CD (`uv.lock` voluntarily in `.gitignore`). + ## 0.10.3 - July, 2025 ### Fixes diff --git a/pyproject.toml b/pyproject.toml index bfe31aa..8ebde75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta" [project] name = "arta" -version = "0.10.3" -requires-python = ">3.8.0" +version = "0.10.4" +requires-python = ">=3.9" description = "A Python Rules Engine - Make rule handling simple" readme = "README.md" license = {text = "Apache-2.0"} @@ -43,11 +43,18 @@ Documentation = "https://maif.github.io/arta/home/" Repository = "https://github.com/MAIF/arta" [project.optional-dependencies] -all = ["arta[test,dev,doc]"] -test = ["pytest", "tox", "pytest-cov"] -dev = ["mypy", "pre-commit", "ruff"] +all = ["arta[test,doc]"] +test = ["pytest", "pytest-cov", "tox", "tox-uv"] doc = ["mkdocs-material", "mkdocstrings[python]"] +[dependency-groups] +dev = [ + "pre-commit", + "pre-commit-uv", + "mypy", + "ruff", +] + [tool.setuptools] package-dir = {"" = "src"}