]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
⬆ Bump ruff from 0.6.2 to 0.9.6 (#1294)
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fri, 7 Mar 2025 03:21:45 +0000 (04:21 +0100)
committerGitHub <noreply@github.com>
Fri, 7 Mar 2025 03:21:45 +0000 (04:21 +0100)
* ⬆ 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](https://github.com/astral-sh/ruff/compare/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>
.pre-commit-config.yaml
requirements-tests.txt
sqlmodel/main.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py310.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial001_py39.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial002.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py310.py
tests/test_tutorial/test_fastapi/test_update/test_tutorial002_py39.py

index 4b1b10a68ff72fc1097a1040c54163ae4076c379..c385ccfd3c0c5ac9fd2f7717a96d38cedc4d6a20 100644 (file)
@@ -14,7 +14,7 @@ repos:
     -   id: end-of-file-fixer
     -   id: trailing-whitespace
 -   repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: v0.6.5
+    rev: v0.9.6
     hooks:
     -   id: ruff
         args:
index f378d8fa626a43a1abc2f132c9c217557d05d2b4..b33f3bf1b7acb509dcb46e02e1ecceeed9454078 100644 (file)
@@ -3,7 +3,7 @@
 pytest >=7.0.1,<8.0.0
 coverage[toml] >=6.2,<8.0
 mypy ==1.4.1
-ruff ==0.6.2
+ruff ==0.9.6
 # For FastAPI tests
 fastapi >=0.103.2
 httpx ==0.24.1
index 317ef6cca5fc315f084d498f87932f2f96780e96..45a41997fe70411e64e64f3cfee7ed24c1033acd 100644 (file)
@@ -134,8 +134,7 @@ class FieldInfo(PydanticFieldInfo):
                 )
             if primary_key is not Undefined:
                 raise RuntimeError(
-                    "Passing primary_key is not supported when "
-                    "also passing a sa_column"
+                    "Passing primary_key is not supported when also passing a sa_column"
                 )
             if nullable is not Undefined:
                 raise RuntimeError(
@@ -143,8 +142,7 @@ class FieldInfo(PydanticFieldInfo):
                 )
             if foreign_key is not Undefined:
                 raise RuntimeError(
-                    "Passing foreign_key is not supported when "
-                    "also passing a sa_column"
+                    "Passing foreign_key is not supported when also passing a sa_column"
                 )
             if ondelete is not Undefined:
                 raise RuntimeError(
index 0856b24676fd1e869a0711a6a3349365f4d29d58..6f3856912e84dd3381d5221e83b3c08cd1f6189c 100644 (file)
@@ -49,16 +49,16 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero2_data["name"], "The name should not be set to none"
-        assert (
-            data["secret_name"] == "Spider-Youngster"
-        ), "The secret name should be updated"
+        assert data["secret_name"] == "Spider-Youngster", (
+            "The secret name should be updated"
+        )
 
         response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero3_data["name"]
         assert data["age"] is None, (
-            "A field should be updatable to None, even if " "that's the default"
+            "A field should be updatable to None, even if that's the default"
         )
 
         response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
index d79b2ecea360bd7555af2448480d070b1fc4383c..119634dc1e5ad9634aa9cf8c6ac2343e976a248c 100644 (file)
@@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero2_data["name"], "The name should not be set to none"
-        assert (
-            data["secret_name"] == "Spider-Youngster"
-        ), "The secret name should be updated"
+        assert data["secret_name"] == "Spider-Youngster", (
+            "The secret name should be updated"
+        )
 
         response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero3_data["name"]
         assert data["age"] is None, (
-            "A field should be updatable to None, even if " "that's the default"
+            "A field should be updatable to None, even if that's the default"
         )
 
         response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
index 1be81dec2e8dc8031ecfad008dbe00fceb03549e..455480f735fcf5f6b31e9fc667c6cc48aabb152e 100644 (file)
@@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero2_data["name"], "The name should not be set to none"
-        assert (
-            data["secret_name"] == "Spider-Youngster"
-        ), "The secret name should be updated"
+        assert data["secret_name"] == "Spider-Youngster", (
+            "The secret name should be updated"
+        )
 
         response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero3_data["name"]
         assert data["age"] is None, (
-            "A field should be updatable to None, even if " "that's the default"
+            "A field should be updatable to None, even if that's the default"
         )
 
         response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
index 32e343ed6142bc283aac4431bd356bafa29def7c..2a929f6dae77ca5adc2b7dcd1ec8281d0093b2df 100644 (file)
@@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero2_data["name"], "The name should not be set to none"
-        assert (
-            data["secret_name"] == "Spider-Youngster"
-        ), "The secret name should be updated"
+        assert data["secret_name"] == "Spider-Youngster", (
+            "The secret name should be updated"
+        )
         assert "password" not in data
         assert "hashed_password" not in data
         with Session(mod.engine) as session:
@@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero3_data["name"]
-        assert (
-            data["age"] is None
-        ), "A field should be updatable to None, even if that's the default"
+        assert data["age"] is None, (
+            "A field should be updatable to None, even if that's the default"
+        )
         assert "password" not in data
         assert "hashed_password" not in data
         with Session(mod.engine) as session:
index b05f5b21333e16dca188ace496574ae9cae75d7b..7617f14996383d4ebe8603541bf7a580ee6627e3 100644 (file)
@@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero2_data["name"], "The name should not be set to none"
-        assert (
-            data["secret_name"] == "Spider-Youngster"
-        ), "The secret name should be updated"
+        assert data["secret_name"] == "Spider-Youngster", (
+            "The secret name should be updated"
+        )
         assert "password" not in data
         assert "hashed_password" not in data
         with Session(mod.engine) as session:
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero3_data["name"]
-        assert (
-            data["age"] is None
-        ), "A field should be updatable to None, even if that's the default"
+        assert data["age"] is None, (
+            "A field should be updatable to None, even if that's the default"
+        )
         assert "password" not in data
         assert "hashed_password" not in data
         with Session(mod.engine) as session:
index 807e33421a2c943c89a9ef56aab90b7f1b342e68..dc788a29f7116d34fd82862710b58367c5b2f35a 100644 (file)
@@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero2_data["name"], "The name should not be set to none"
-        assert (
-            data["secret_name"] == "Spider-Youngster"
-        ), "The secret name should be updated"
+        assert data["secret_name"] == "Spider-Youngster", (
+            "The secret name should be updated"
+        )
         assert "password" not in data
         assert "hashed_password" not in data
         with Session(mod.engine) as session:
@@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
         data = response.json()
         assert response.status_code == 200, response.text
         assert data["name"] == hero3_data["name"]
-        assert (
-            data["age"] is None
-        ), "A field should be updatable to None, even if that's the default"
+        assert data["age"] is None, (
+            "A field should be updatable to None, even if that's the default"
+        )
         assert "password" not in data
         assert "hashed_password" not in data
         with Session(mod.engine) as session: