mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-10-28 04:05:15 +08:00
⬆ 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](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>
This commit is contained in:
@ -14,7 +14,7 @@ repos:
|
|||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.6.5
|
rev: v0.9.6
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args:
|
args:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
pytest >=7.0.1,<8.0.0
|
pytest >=7.0.1,<8.0.0
|
||||||
coverage[toml] >=6.2,<8.0
|
coverage[toml] >=6.2,<8.0
|
||||||
mypy ==1.4.1
|
mypy ==1.4.1
|
||||||
ruff ==0.6.2
|
ruff ==0.9.6
|
||||||
# For FastAPI tests
|
# For FastAPI tests
|
||||||
fastapi >=0.103.2
|
fastapi >=0.103.2
|
||||||
httpx ==0.24.1
|
httpx ==0.24.1
|
||||||
|
|||||||
@ -134,8 +134,7 @@ class FieldInfo(PydanticFieldInfo):
|
|||||||
)
|
)
|
||||||
if primary_key is not Undefined:
|
if primary_key is not Undefined:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Passing primary_key is not supported when "
|
"Passing primary_key is not supported when also passing a sa_column"
|
||||||
"also passing a sa_column"
|
|
||||||
)
|
)
|
||||||
if nullable is not Undefined:
|
if nullable is not Undefined:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
@ -143,8 +142,7 @@ class FieldInfo(PydanticFieldInfo):
|
|||||||
)
|
)
|
||||||
if foreign_key is not Undefined:
|
if foreign_key is not Undefined:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Passing foreign_key is not supported when "
|
"Passing foreign_key is not supported when also passing a sa_column"
|
||||||
"also passing a sa_column"
|
|
||||||
)
|
)
|
||||||
if ondelete is not Undefined:
|
if ondelete is not Undefined:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
|||||||
@ -49,16 +49,16 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
||||||
assert (
|
assert data["secret_name"] == "Spider-Youngster", (
|
||||||
data["secret_name"] == "Spider-Youngster"
|
"The secret name should be updated"
|
||||||
), "The secret name should be updated"
|
)
|
||||||
|
|
||||||
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
|
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
|
||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero3_data["name"]
|
assert data["name"] == hero3_data["name"]
|
||||||
assert data["age"] is None, (
|
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"})
|
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
|
||||||
|
|||||||
@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
||||||
assert (
|
assert data["secret_name"] == "Spider-Youngster", (
|
||||||
data["secret_name"] == "Spider-Youngster"
|
"The secret name should be updated"
|
||||||
), "The secret name should be updated"
|
)
|
||||||
|
|
||||||
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
|
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
|
||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero3_data["name"]
|
assert data["name"] == hero3_data["name"]
|
||||||
assert data["age"] is None, (
|
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"})
|
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
|
||||||
|
|||||||
@ -52,16 +52,16 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
||||||
assert (
|
assert data["secret_name"] == "Spider-Youngster", (
|
||||||
data["secret_name"] == "Spider-Youngster"
|
"The secret name should be updated"
|
||||||
), "The secret name should be updated"
|
)
|
||||||
|
|
||||||
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
|
response = client.patch(f"/heroes/{hero3_id}", json={"age": None})
|
||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero3_data["name"]
|
assert data["name"] == hero3_data["name"]
|
||||||
assert data["age"] is None, (
|
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"})
|
response = client.patch("/heroes/9001", json={"name": "Dragon Cube X"})
|
||||||
|
|||||||
@ -80,9 +80,9 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
||||||
assert (
|
assert data["secret_name"] == "Spider-Youngster", (
|
||||||
data["secret_name"] == "Spider-Youngster"
|
"The secret name should be updated"
|
||||||
), "The secret name should be updated"
|
)
|
||||||
assert "password" not in data
|
assert "password" not in data
|
||||||
assert "hashed_password" not in data
|
assert "hashed_password" not in data
|
||||||
with Session(mod.engine) as session:
|
with Session(mod.engine) as session:
|
||||||
@ -95,9 +95,9 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero3_data["name"]
|
assert data["name"] == hero3_data["name"]
|
||||||
assert (
|
assert data["age"] is None, (
|
||||||
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"
|
)
|
||||||
assert "password" not in data
|
assert "password" not in data
|
||||||
assert "hashed_password" not in data
|
assert "hashed_password" not in data
|
||||||
with Session(mod.engine) as session:
|
with Session(mod.engine) as session:
|
||||||
|
|||||||
@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
||||||
assert (
|
assert data["secret_name"] == "Spider-Youngster", (
|
||||||
data["secret_name"] == "Spider-Youngster"
|
"The secret name should be updated"
|
||||||
), "The secret name should be updated"
|
)
|
||||||
assert "password" not in data
|
assert "password" not in data
|
||||||
assert "hashed_password" not in data
|
assert "hashed_password" not in data
|
||||||
with Session(mod.engine) as session:
|
with Session(mod.engine) as session:
|
||||||
@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero3_data["name"]
|
assert data["name"] == hero3_data["name"]
|
||||||
assert (
|
assert data["age"] is None, (
|
||||||
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"
|
)
|
||||||
assert "password" not in data
|
assert "password" not in data
|
||||||
assert "hashed_password" not in data
|
assert "hashed_password" not in data
|
||||||
with Session(mod.engine) as session:
|
with Session(mod.engine) as session:
|
||||||
|
|||||||
@ -83,9 +83,9 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
assert data["name"] == hero2_data["name"], "The name should not be set to none"
|
||||||
assert (
|
assert data["secret_name"] == "Spider-Youngster", (
|
||||||
data["secret_name"] == "Spider-Youngster"
|
"The secret name should be updated"
|
||||||
), "The secret name should be updated"
|
)
|
||||||
assert "password" not in data
|
assert "password" not in data
|
||||||
assert "hashed_password" not in data
|
assert "hashed_password" not in data
|
||||||
with Session(mod.engine) as session:
|
with Session(mod.engine) as session:
|
||||||
@ -98,9 +98,9 @@ def test_tutorial(clear_sqlmodel):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
assert data["name"] == hero3_data["name"]
|
assert data["name"] == hero3_data["name"]
|
||||||
assert (
|
assert data["age"] is None, (
|
||||||
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"
|
)
|
||||||
assert "password" not in data
|
assert "password" not in data
|
||||||
assert "hashed_password" not in data
|
assert "hashed_password" not in data
|
||||||
with Session(mod.engine) as session:
|
with Session(mod.engine) as session:
|
||||||
|
|||||||
Reference in New Issue
Block a user