Skip to content

Commit 468a219

Browse files
authored
ci: fix python versions for tests and use uv (#51)
* ci: fix python versions for tox Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * chore: fix requires-python Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * ci: use uv Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> --------- Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com>
1 parent 5a2611c commit 468a219

File tree

7 files changed

+63
-36
lines changed

7 files changed

+63
-36
lines changed

.github/workflows/ci-cd-docs.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ jobs:
1919
name: Build doc
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
23-
- name: Install Python
24-
uses: actions/setup-python@v5
22+
- uses: actions/checkout@v5
23+
- name: Set up Python
24+
uses: actions/setup-python@v6
2525
with:
26-
python-version: '3.x'
27-
- name: Install package with optional dependency 'doc'
28-
run: |
29-
python -m pip install --upgrade pip
30-
pip install .[doc]
26+
python-version-file: .python-version
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v6
29+
- name: Install package with extra 'doc'
30+
run: uv sync --extra doc --dev
3131
- name: Run MkDocs build
3232
working-directory: ./docs
33-
run: mkdocs build
33+
run: uv run mkdocs build
3434
- name: Upload Pages artifact
35-
uses: actions/upload-pages-artifact@v3
35+
uses: actions/upload-pages-artifact@v4
3636
with:
37-
path: "docs/site/"
37+
path: docs/site/
3838
publish:
3939
if: success() && startsWith(github.ref, 'refs/tags')
4040
name: Publish doc

.github/workflows/ci-cd.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,32 @@ jobs:
1717
pre-commit:
1818
name: Apply pre-commit hooks
1919
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
python-version:
23+
- '3.9'
24+
- '3.10'
25+
- '3.11'
26+
- '3.12'
27+
- '3.13'
2028
steps:
2129
- name: Checkout
22-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
2331
- name: Set up Python version
24-
uses: actions/setup-python@v5
32+
uses: actions/setup-python@v6
2533
with:
26-
python-version: '3.x'
27-
- name: Install extra dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
pip install .[dev,test]
34+
python-version: ${{ matrix.python-version }}
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v6
37+
- name: Install package with extra 'test'
38+
run: uv sync --extra test --dev
3139
- name: Cache pre-commit hooks
3240
uses: actions/cache@v4
3341
with:
3442
path: ~/.cache/pre-commit
3543
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
3644
- name: Run pre-commit hooks
37-
run: pre-commit run --all-files
45+
run: uv run pre-commit run --all-files
3846
publish:
3947
needs: pre-commit
4048
if: success() && startsWith(github.ref, 'refs/tags')
@@ -45,14 +53,12 @@ jobs:
4553
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
4654
steps:
4755
- name: Checkout
48-
uses: actions/checkout@v4
56+
uses: actions/checkout@v5
4957
- name: Set up Python version
50-
uses: actions/setup-python@v5
58+
uses: actions/setup-python@v6
5159
with:
52-
python-version: '3.x'
60+
python-version-file: .python-version
5361
- name: Build package
54-
run: |
55-
python -m pip install --upgrade build
56-
python -m build
62+
run: uv build
5763
- name: Upload package distributions to PyPI
5864
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ profile_default/
8282
ipython_config.py
8383

8484
# pyenv
85-
.python-version
85+
# .python-version
8686

8787
# pipenv
8888
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@@ -140,3 +140,6 @@ dmypy.json
140140

141141
# OS
142142
.DS_Store
143+
144+
# uv
145+
uv.lock

.pre-commit-config.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ default_language_version:
33
python: python3
44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v5.0.0
6+
rev: v6.0.0
77
hooks:
88
- id: check-ast
9-
- id: check-byte-order-marker
9+
- id: fix-byte-order-marker
1010
- id: check-case-conflict
1111
- id: check-docstring-first
1212
- id: check-json
@@ -25,14 +25,18 @@ repos:
2525
exclude: ^(docs/)
2626
- id: check-added-large-files
2727
args: [--maxkb=500]
28+
- repo: https://github.com/astral-sh/uv-pre-commit
29+
rev: 0.8.23
30+
hooks:
31+
- id: uv-lock
2832
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: v0.12.1
33+
rev: v0.13.3
3034
hooks:
3135
- id: ruff
3236
args: [--fix]
3337
- id: ruff-format
3438
- repo: https://github.com/pre-commit/mirrors-mypy
35-
rev: v1.16.1
39+
rev: v1.18.2
3640
hooks:
3741
- id: mypy
3842
args: [--config-file=pyproject.toml]
@@ -44,7 +48,7 @@ repos:
4448
# hooks:
4549
# - id: gitleaks
4650
- repo: https://github.com/pypa/pip-audit
47-
rev: v2.8.0
51+
rev: v2.9.0
4852
hooks:
4953
- id: pip-audit
5054
args: [.]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
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).
66

7+
## 0.10.4 - October, 2025
8+
9+
### Maintenance
10+
11+
* Use [uv](https://docs.astral.sh/uv/) in CI/CD (`uv.lock` voluntarily in `.gitignore`).
12+
713
## 0.10.3 - July, 2025
814

915
### Fixes

pyproject.toml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "arta"
7-
version = "0.10.3"
8-
requires-python = ">3.8.0"
7+
version = "0.10.4"
8+
requires-python = ">=3.9"
99
description = "A Python Rules Engine - Make rule handling simple"
1010
readme = "README.md"
1111
license = {text = "Apache-2.0"}
@@ -43,11 +43,18 @@ Documentation = "https://maif.github.io/arta/home/"
4343
Repository = "https://github.com/MAIF/arta"
4444

4545
[project.optional-dependencies]
46-
all = ["arta[test,dev,doc]"]
47-
test = ["pytest", "tox", "pytest-cov"]
48-
dev = ["mypy", "pre-commit", "ruff"]
46+
all = ["arta[test,doc]"]
47+
test = ["pytest", "pytest-cov", "tox", "tox-uv"]
4948
doc = ["mkdocs-material", "mkdocstrings[python]"]
5049

50+
[dependency-groups]
51+
dev = [
52+
"pre-commit",
53+
"pre-commit-uv",
54+
"mypy",
55+
"ruff",
56+
]
57+
5158
[tool.setuptools]
5259
package-dir = {"" = "src"}
5360

0 commit comments

Comments
 (0)