Skip to content

Commit 3f12254

Browse files
committed
Set up ruff and format python code
1 parent 3435212 commit 3f12254

File tree

5 files changed

+43
-10
lines changed

5 files changed

+43
-10
lines changed

source/python/pyproject.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ features = ["pyo3/extension-module"]
1818
python-source = "python"
1919
module-name = "autonomy.autonomy_in_rust_for_python"
2020

21+
[tool.ruff]
22+
indent-width = 2
23+
line-length = 100
24+
25+
[tool.ruff.format]
26+
quote-style = "double"
27+
indent-style = "space"
28+
docstring-code-format = true
29+
2130
[dependency-groups]
22-
dev = [
23-
"maturin>=1.9.2",
24-
"pytest>=8.4.1",
25-
]
31+
dev = ["maturin>=1.9.2", "pytest>=8.4.1", "ruff>=0.12.8"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .model import Model
22

33
__all__ = [
4-
"Model",
4+
"Model",
55
]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
class Model:
32
def __init__(self, name):
43
self.name = name

source/python/tests/model_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
from autonomy.models.model import Model
44

5+
56
class TestModel:
6-
def test_constructor_sets_name_correctly(self):
7-
expected = "test_model"
8-
model = Model(expected)
9-
assert model.name == expected
7+
def test_constructor_sets_name_correctly(self):
8+
expected = "test_model"
9+
model = Model(expected)
10+
assert model.name == expected

source/python/uv.lock

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

0 commit comments

Comments
 (0)