Skip to content

Commit 5f1f377

Browse files
committed
feat: update pre-commit configuration and workflows for uv migration
1 parent 6c50ae1 commit 5f1f377

File tree

8 files changed

+45
-57
lines changed

8 files changed

+45
-57
lines changed

.github/workflows/build-and-release.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v4
1414

15-
- name: Set up Python
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
17+
18+
- name: "Set up Python"
1619
uses: actions/setup-python@v5
1720
with:
18-
python-version: "3.8"
21+
python-version-file: ".python-version"
22+
23+
- name: Install the project
24+
run: uv sync --all-extras --dev
1925

20-
- name: Install dependencies
21-
run: |
22-
python -m pip install poetry
23-
poetry install
26+
- name: Build the project
27+
run: uv build
2428

25-
- name: Poetry publish
26-
run: |
27-
poetry config pypi-token.pypi "${{ secrets.PYPI_API_TOKEN }}"
28-
poetry publish --build
29+
- name: Upload the project to PyPI
30+
run: uv publish --token "${{ secrets.PYPI_API_TOKEN }}"
2931

3032
- name: Release to Github
3133
uses: softprops/action-gh-release@v1

.github/workflows/main.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: Set up Python
15+
- name: Install uv and set the python version
16+
uses: astral-sh/setup-uv@v5
17+
18+
- name: "Set up Python"
1619
uses: actions/setup-python@v5
1720
with:
18-
python-version: "3.8"
19-
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install poetry
23-
poetry install
21+
python-version-file: ".python-version"
2422

2523
- name: Pre Commit
2624
uses: pre-commit/action@v3.0.1

.github/workflows/test.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v5
20+
21+
- name: Install uv and set the python version
22+
uses: astral-sh/setup-uv@v5
2223
with:
2324
python-version: ${{ matrix.python-version }}
24-
cache: pip
25-
cache-dependency-path: setup.py
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install poetry
29-
poetry install
25+
26+
- name: Install the project
27+
run: uv sync --all-extras --dev
28+
3029
- name: Ubuntu keyring setup
3130
if: ${{ matrix.os == 'ubuntu-latest' }}
3231
uses: t1m0thyj/unlock-keyring@v1
32+
3333
- name: MacOS keychain setup
3434
if: ${{ matrix.os == 'macos-latest' }}
3535
run: |
@@ -39,6 +39,6 @@ jobs:
3939
4040
- name: Run tests
4141
run: |
42-
poetry run archivooor
43-
poetry run archivooor keys set test_value test_secret
44-
poetry run archivooor keys delete
42+
uv run archivooor
43+
uv run archivooor keys set test_value test_secret
44+
uv run archivooor keys delete test_value

.pre-commit-config.yaml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,13 @@ repos:
88
- id: trailing-whitespace
99
- id: end-of-file-fixer
1010
- id: no-commit-to-branch
11-
- repo: https://github.com/psf/black
12-
rev: 24.4.0
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: 0.11.0
1313
hooks:
14-
- id: black
14+
- id: ruff
15+
- id: ruff-format
1516
files: \.py$
16-
- repo: https://github.com/PyCQA/isort
17-
rev: 5.13.0
17+
- repo: https://github.com/astral-sh/uv-pre-commit
18+
rev: 0.6.8
1819
hooks:
19-
# Use isort for sorting imports.
20-
- id: isort
21-
additional_dependencies: ["toml"]
22-
files: \.py$
23-
- repo: local
24-
hooks:
25-
- id: poetry-check
26-
name: Poetry check
27-
description:
28-
Validates the content of the pyproject.toml file and its consistency
29-
with the poetry.lock file.
30-
entry: poetry check
31-
language: system
32-
pass_filenames: false
33-
files: pyproject.toml
20+
- id: uv-lock

.python-version

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

Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ help:
33
@echo "install-dev - install all dependencies for development"
44

55
install-dev:
6-
poetry install --with dev --all-extras
6+
uv sync --all-extras --dev
77

88
lint:
99
@ERROR=0; \
10-
poetry run isort archivooor || ERROR=1; \
11-
poetry run black archivooor || ERROR=1; \
12-
poetry run pydocstyle archivooor || ERROR=1; \
13-
poetry run pylint archivooor || ERROR=1; \
14-
poetry run mypy archivooor || ERROR=1; \
15-
poetry run pre-commit run --all || ERROR=1; \
10+
uv run ruff check --fix || ERROR=1; \
11+
uv run mypy archivooor || ERROR=1; \
1612
exit $$ERROR

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ archivooor = "archivooor.cli:cli"
2626
[dependency-groups]
2727
dev = ["mypy>=1.15.0", "pre-commit>=4.2.0", "ruff>=0.11.0"]
2828

29+
[build-system]
30+
requires = ["hatchling"]
31+
build-backend = "hatchling.build"
32+
2933
[tool.ruff.lint]
3034
select = [
3135
"I", # isort

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)