Skip to content

Commit ec61952

Browse files
python: Format & ensure it stays like that with CI
1 parent 98447d5 commit ec61952

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/python.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,26 @@ jobs:
5656
export $(gnome-keyring-daemon --start)
5757
cd python && pytest -v
5858
'
59+
60+
lint:
61+
name: Lint Python bindings
62+
runs-on: ubuntu-latest
63+
64+
steps:
65+
- uses: actions/checkout@v6
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: '3.13'
71+
72+
- name: Install ruff
73+
run: pip install ruff
74+
75+
- name: Check Python formatting
76+
working-directory: python
77+
run: ruff format --check tests/
78+
79+
- name: Check Python linting
80+
working-directory: python
81+
run: ruff check tests/

python/pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ classifiers = [
2727

2828
[tool.maturin]
2929
include = ["oo7.pyi", "py.typed"]
30+
31+
[tool.ruff]
32+
line-length = 88
33+
target-version = "py38"
34+
35+
[tool.ruff.lint]
36+
select = ["E", "F", "I", "UP"]
37+
ignore = []

python/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
maturin>=1.0,<2.0
22
pytest>=7.0
33
pytest-asyncio>=0.21
4+
ruff>=0.1.0

python/tests/test_keyring.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import pytest
6+
67
import oo7
78

89

0 commit comments

Comments
 (0)