Skip to content

Commit 9d31cee

Browse files
Don't fix ruff version for the compiler (#159)
* Allow more flexible ruff version * Update ruff in lib * Fix Ruff version in dev * Update workflow name * Update Ruff config * Add version constraint * Add known third parties imports
1 parent a98380f commit 9d31cee

File tree

7 files changed

+1652
-1321
lines changed

7 files changed

+1652
-1321
lines changed

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313

1414
jobs:
1515
code-quality:
16-
name: Check code/doc formatting
16+
name: Check code formatting and typechecking
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33

44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
6-
rev: v0.9.3
6+
rev: v0.14.2
77
hooks:
88
- id: ruff-format
99
args: ["--diff", "betterproto2/src", "betterproto2/tests", "betterproto2_compiler/src", "betterproto2_compiler/tests"]

betterproto2/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dev = [
3434
"pre-commit>=4.2.0,<5",
3535
"pyright>=1.1.401",
3636
# The Ruff version is pinned. To update it, also update it in .pre-commit-config.yaml
37-
"ruff==0.9.3",
37+
"ruff==0.14.2",
3838
]
3939
test = [
4040
"cachelib>=0.13.0",
@@ -77,6 +77,8 @@ select = [
7777

7878
[tool.ruff.lint.isort]
7979
combine-as-imports = true
80+
known-first-party = ["tests"]
81+
known-third-party = ["grpclib", "pydantic", "google"]
8082

8183
[tool.pytest.ini_options]
8284
python_files = "test_*.py"

betterproto2/tests/inputs/timestamp_dict_encode/test_timestamp_dict_encode.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
from datetime import (
2-
datetime,
3-
timedelta,
4-
timezone,
5-
)
1+
from datetime import datetime, timedelta, timezone
62

73
import pytest
84

betterproto2/uv.lock

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

betterproto2_compiler/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies = [
1717
# TODO use the version from the current repo?
1818
"betterproto2>=0.9.0,<0.10",
1919
# "betterproto2",
20-
"ruff~=0.9.3",
20+
"ruff>=0.9.3,<0.15.0",
2121
"jinja2>=3.0.3",
2222
"typing-extensions>=4.7.1,<5",
2323
"strenum>=0.4.15,<0.5 ; python_version == '3.10'",
@@ -40,6 +40,7 @@ dev = [
4040
"poethepoet>=0.32.2,<0.33",
4141
"pyright>=1.1.391,<2",
4242
"ipykernel>=6.29.5,<7",
43+
"ruff==0.14.2",
4344
]
4445
test = [
4546
"pytest>=8.3.4,<9",

betterproto2_compiler/uv.lock

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

0 commit comments

Comments
 (0)