Skip to content

Commit 1e853aa

Browse files
dependabot[bot]svlandegpre-commit-ci[bot]
authored
⬆ Bump ruff from 0.6.2 to 0.9.6 (#1294)
* ⬆ Bump ruff from 0.6.2 to 0.9.6 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.2 to 0.9.6. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.6.2...0.9.6) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * format with ruff 0.9.6 * 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks * also bump in pre-commit config * 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 262610c commit 1e853aa

File tree

9 files changed

+34
-36
lines changed

9 files changed

+34
-36
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.6.5
17+
rev: v0.9.6
1818
hooks:
1919
- id: ruff
2020
args:

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pytest >=7.0.1,<8.0.0
44
coverage[toml] >=6.2,<8.0
55
mypy ==1.4.1
6-
ruff ==0.6.2
6+
ruff ==0.9.6
77
# For FastAPI tests
88
fastapi >=0.103.2
99
httpx ==0.24.1

sqlmodel/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,15 @@ def __init__(self, default: Any = Undefined, **kwargs: Any) -> None:
134134
)
135135
if primary_key is not Undefined:
136136
raise RuntimeError(
137-
"Passing primary_key is not supported when "
138-
"also passing a sa_column"
137+
"Passing primary_key is not supported when also passing a sa_column"
139138
)
140139
if nullable is not Undefined:
141140
raise RuntimeError(
142141
"Passing nullable is not supported when also passing a sa_column"
143142
)
144143
if foreign_key is not Undefined:
145144
raise RuntimeError(
146-
"Passing foreign_key is not supported when "
147-
"also passing a sa_column"
145+
"Passing foreign_key is not supported when also passing a sa_column"
148146
)
149147
if ondelete is not Undefined:
150148
raise RuntimeError(

tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ def test_tutorial(clear_sqlmodel):
4949
data = response.json()
5050
assert response.status_code == 200, response.text
5151
assert data["name"] == hero2_data["name"], "The name should not be set to none"
52-
assert (
53-
data["secret_name"] == "Spider-Youngster"
54-
), "The secret name should be updated"
52+
assert data["secret_name"] == "Spider-Youngster", (
53+
"The secret name should be updated"
54+
)
5555

5656
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
5757
data = response.json()
5858
assert response.status_code == 200, response.text
5959
assert data["name"] == hero3_data["name"]
6060
assert data["age"] is None, (
61-
"A field should be updatable to None, even if " "that's the default"
61+
"A field should be updatable to None, even if that's the default"
6262
)
6363

6464
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})

tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
5252
data = response.json()
5353
assert response.status_code == 200, response.text
5454
assert data["name"] == hero2_data["name"], "The name should not be set to none"
55-
assert (
56-
data["secret_name"] == "Spider-Youngster"
57-
), "The secret name should be updated"
55+
assert data["secret_name"] == "Spider-Youngster", (
56+
"The secret name should be updated"
57+
)
5858

5959
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
6060
data = response.json()
6161
assert response.status_code == 200, response.text
6262
assert data["name"] == hero3_data["name"]
6363
assert data["age"] is None, (
64-
"A field should be updatable to None, even if " "that's the default"
64+
"A field should be updatable to None, even if that's the default"
6565
)
6666

6767
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})

tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
5252
data = response.json()
5353
assert response.status_code == 200, response.text
5454
assert data["name"] == hero2_data["name"], "The name should not be set to none"
55-
assert (
56-
data["secret_name"] == "Spider-Youngster"
57-
), "The secret name should be updated"
55+
assert data["secret_name"] == "Spider-Youngster", (
56+
"The secret name should be updated"
57+
)
5858

5959
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
6060
data = response.json()
6161
assert response.status_code == 200, response.text
6262
assert data["name"] == hero3_data["name"]
6363
assert data["age"] is None, (
64-
"A field should be updatable to None, even if " "that's the default"
64+
"A field should be updatable to None, even if that's the default"
6565
)
6666

6767
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})

tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel):
8080
data = response.json()
8181
assert response.status_code == 200, response.text
8282
assert data["name"] == hero2_data["name"], "The name should not be set to none"
83-
assert (
84-
data["secret_name"] == "Spider-Youngster"
85-
), "The secret name should be updated"
83+
assert data["secret_name"] == "Spider-Youngster", (
84+
"The secret name should be updated"
85+
)
8686
assert "password" not in data
8787
assert "hashed_password" not in data
8888
with Session(mod.engine) as session:
@@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel):
9595
data = response.json()
9696
assert response.status_code == 200, response.text
9797
assert data["name"] == hero3_data["name"]
98-
assert (
99-
data["age"] is None
100-
), "A field should be updatable to None, even if that's the default"
98+
assert data["age"] is None, (
99+
"A field should be updatable to None, even if that's the default"
100+
)
101101
assert "password" not in data
102102
assert "hashed_password" not in data
103103
with Session(mod.engine) as session:

tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
8383
data = response.json()
8484
assert response.status_code == 200, response.text
8585
assert data["name"] == hero2_data["name"], "The name should not be set to none"
86-
assert (
87-
data["secret_name"] == "Spider-Youngster"
88-
), "The secret name should be updated"
86+
assert data["secret_name"] == "Spider-Youngster", (
87+
"The secret name should be updated"
88+
)
8989
assert "password" not in data
9090
assert "hashed_password" not in data
9191
with Session(mod.engine) as session:
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
9898
data = response.json()
9999
assert response.status_code == 200, response.text
100100
assert data["name"] == hero3_data["name"]
101-
assert (
102-
data["age"] is None
103-
), "A field should be updatable to None, even if that's the default"
101+
assert data["age"] is None, (
102+
"A field should be updatable to None, even if that's the default"
103+
)
104104
assert "password" not in data
105105
assert "hashed_password" not in data
106106
with Session(mod.engine) as session:

tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
8383
data = response.json()
8484
assert response.status_code == 200, response.text
8585
assert data["name"] == hero2_data["name"], "The name should not be set to none"
86-
assert (
87-
data["secret_name"] == "Spider-Youngster"
88-
), "The secret name should be updated"
86+
assert data["secret_name"] == "Spider-Youngster", (
87+
"The secret name should be updated"
88+
)
8989
assert "password" not in data
9090
assert "hashed_password" not in data
9191
with Session(mod.engine) as session:
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
9898
data = response.json()
9999
assert response.status_code == 200, response.text
100100
assert data["name"] == hero3_data["name"]
101-
assert (
102-
data["age"] is None
103-
), "A field should be updatable to None, even if that's the default"
101+
assert data["age"] is None, (
102+
"A field should be updatable to None, even if that's the default"
103+
)
104104
assert "password" not in data
105105
assert "hashed_password" not in data
106106
with Session(mod.engine) as session:

0 commit comments

Comments
 (0)