Skip to content

Commit 73616d3

Browse files
committed
Merge branch 'main' into update/python
2 parents 4891994 + bf376f8 commit 73616d3

File tree

12 files changed

+31
-20
lines changed

12 files changed

+31
-20
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
3535
run: python -m build
3636
- name: Publish
37-
uses: pypa/gh-action-pypi-publish@v1.12.3
37+
uses: pypa/gh-action-pypi-publish@v1.12.4

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<em>SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.</em>
77
</p>
88
<p align="center">
9-
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3ATest" target="_blank">
10-
<img src="https://github.com/fastapi/sqlmodel/workflows/Test/badge.svg" alt="Test">
9+
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3ATest+event%3Apush+branch%3Amain" target="_blank">
10+
<img src="https://github.com/fastapi/sqlmodel/actions/workflows/test.yml/badge.svg?event=push&branch=main" alt="Test">
1111
</a>
1212
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3APublish" target="_blank">
13-
<img src="https://github.com/fastapi/sqlmodel/workflows/Publish/badge.svg" alt="Publish">
13+
<img src="https://github.com/fastapi/sqlmodel/actions/workflows/publish.yml/badge.svg" alt="Publish">
1414
</a>
1515
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/sqlmodel" target="_blank">
1616
<img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/sqlmodel.svg" alt="Coverage">

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<em>SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.</em>
1313
</p>
1414
<p align="center">
15-
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3ATest" target="_blank">
16-
<img src="https://github.com/fastapi/sqlmodel/workflows/Test/badge.svg" alt="Test">
15+
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3ATest+event%3Apush+branch%3Amain" target="_blank">
16+
<img src="https://github.com/fastapi/sqlmodel/actions/workflows/test.yml/badge.svg?event=push&branch=main" alt="Test">
1717
</a>
1818
<a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3APublish" target="_blank">
19-
<img src="https://github.com/fastapi/sqlmodel/workflows/Publish/badge.svg" alt="Publish">
19+
<img src="https://github.com/fastapi/sqlmodel/actions/workflows/publish.yml/badge.svg" alt="Publish">
2020
</a>
2121
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/sqlmodel" target="_blank">
2222
<img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/sqlmodel.svg" alt="Coverage">

docs/release-notes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
## Latest Changes
44

5+
## 0.0.23
6+
7+
### Fixes
8+
9+
* 🐛 Fix type annotation in `Field` constructor. PR [#1304](https://github.com/fastapi/sqlmodel/pull/1304) by [@AlanBogarin](https://github.com/AlanBogarin).
10+
* 🐛 Fix Pydantic version check for version 2.10.x onwards. PR [#1255](https://github.com/fastapi/sqlmodel/pull/1255) by [@asiunov](https://github.com/asiunov).
11+
512
### Refactors
613

714
* 🚨 Fix types for new Pydantic. PR [#1131](https://github.com/fastapi/sqlmodel/pull/1131) by [@tiangolo](https://github.com/tiangolo).
815

916
### Docs
1017

18+
* 🩺 Take the GH badge only from pushes to the `main` branch. PR [#1291](https://github.com/fastapi/sqlmodel/pull/1291) by [@svlandeg](https://github.com/svlandeg).
19+
* 📝 Update documentation to refer to `list` instead of `List`. PR [#1147](https://github.com/fastapi/sqlmodel/pull/1147) by [@bubbletroubles](https://github.com/bubbletroubles).
1120
* ✏️ Fix typo in `databases.md`. PR [#1113](https://github.com/fastapi/sqlmodel/pull/1113) by [@radi-dev](https://github.com/radi-dev).
1221
* ✏️ Fix typo in `docs/tutorial/create-db-and-table.md`. PR [#1252](https://github.com/fastapi/sqlmodel/pull/1252) by [@ArianHamdi](https://github.com/ArianHamdi).
1322
* ✏️ Fix typo in `insert.md`. PR [#1256](https://github.com/fastapi/sqlmodel/pull/1256) by [@Noushadaliam](https://github.com/Noushadaliam).
@@ -22,6 +31,7 @@
2231

2332
### Internal
2433

34+
* ⬆ Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4. PR [#1277](https://github.com/fastapi/sqlmodel/pull/1277) by [@dependabot[bot]](https://github.com/apps/dependabot).
2535
* 💚 Fix CI test suite for Python 3.7. PR [#1309](https://github.com/fastapi/sqlmodel/pull/1309) by [@svlandeg](https://github.com/svlandeg).
2636
* 👷 Revert "Add Codecov to CI, Smokeshow/Cloudflare has been flaky lately (#1303)". PR [#1306](https://github.com/fastapi/sqlmodel/pull/1306) by [@svlandeg](https://github.com/svlandeg).
2737
* 👷 Add Codecov to CI, Smokeshow/Cloudflare has been flaky lately. PR [#1303](https://github.com/fastapi/sqlmodel/pull/1303) by [@tiangolo](https://github.com/tiangolo).

docs/tutorial/code-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ And this ends up *requiring* the same **circular imports** that are not supporte
183183

184184
But these **type annotations** we want to declare are not needed at *runtime*.
185185

186-
In fact, remember that we used `List["Hero"]`, with a `"Hero"` in a string?
186+
In fact, remember that we used `list["Hero"]`, with a `"Hero"` in a string?
187187

188188
For Python, at runtime, that is **just a string**.
189189

docs/tutorial/fastapi/response-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ For example, we can pass the same `Hero` **SQLModel** class (because it is also
3838

3939
We can also use other type annotations, the same way we can use with Pydantic fields. For example, we can pass a list of `Hero`s.
4040

41-
First, we import `List` from `typing` and then we declare the `response_model` with `List[Hero]`:
41+
To do so, we declare the `response_model` with `list[Hero]`:
4242

4343
{* ./docs_src/tutorial/fastapi/response_model/tutorial001_py310.py ln[40:44] hl[40] *}
4444

docs/tutorial/many-to-many/create-models-with-link.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Let's see the `Team` model, it's almost identical as before, but with a little c
2828

2929
{* ./docs_src/tutorial/many_to_many/tutorial001_py310.py ln[9:14] hl[14] *}
3030

31-
The **relationship attribute `heroes`** is still a list of heroes, annotated as `List["Hero"]`. Again, we use `"Hero"` in quotes because we haven't declared that class yet by this point in the code (but as you know, editors and **SQLModel** understand that).
31+
The **relationship attribute `heroes`** is still a list of heroes, annotated as `list["Hero"]`. Again, we use `"Hero"` in quotes because we haven't declared that class yet by this point in the code (but as you know, editors and **SQLModel** understand that).
3232

3333
We use the same **`Relationship()`** function.
3434

@@ -46,7 +46,7 @@ We **removed** the previous `team_id` field (column) because now the relationshi
4646

4747
The relationship attribute is now named **`teams`** instead of `team`, as now we support multiple teams.
4848

49-
It is no longer an `Optional[Team]` but a list of teams, annotated as **`List[Team]`**.
49+
It is no longer an `Optional[Team]` but a list of teams, annotated as **`list[Team]`**.
5050

5151
We are using the **`Relationship()`** here too.
5252

docs/tutorial/relationship-attributes/define-relationships-attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ And in the `Team` class, the `heroes` attribute is annotated as a list of `Hero`
8686

8787
/// tip
8888

89-
There's a couple of things we'll check again in some of the next chapters, about the `List["Hero"]` and the `back_populates`.
89+
There's a couple of things we'll check again in some of the next chapters, about the `list["Hero"]` and the `back_populates`.
9090

9191
But for now, let's first see how to use these relationship attributes.
9292

docs/tutorial/relationship-attributes/type-annotation-strings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## About the String in `List["Hero"]`
1+
## About the String in `list["Hero"]`
22

3-
In the first Relationship attribute, we declare it with `List["Hero"]`, putting the `Hero` in quotes instead of just normally there:
3+
In the first Relationship attribute, we declare it with `list["Hero"]`, putting the `Hero` in quotes instead of just normally there:
44

55
{* ./docs_src/tutorial/relationship_attributes/define_relationship_attributes/tutorial001_py310.py ln[1:19] hl[9] *}
66

7-
What's that about? Can't we just write it normally as `List[Hero]`?
7+
What's that about? Can't we just write it normally as `list[Hero]`?
88

99
By that point, in that line in the code, the Python interpreter **doesn't know of any class `Hero`**, and if we put it just there, it would try to find it unsuccessfully, and then fail. 😭
1010

sqlmodel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.0.22"
1+
__version__ = "0.0.23"
22

33
# Re-export from SQLAlchemy
44
from sqlalchemy.engine import create_engine as create_engine

sqlmodel/_compat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525

2626
# Reassign variable to make it reexported for mypy
2727
PYDANTIC_VERSION = P_VERSION
28-
IS_PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
28+
PYDANTIC_MINOR_VERSION = tuple(int(i) for i in P_VERSION.split(".")[:2])
29+
IS_PYDANTIC_V2 = PYDANTIC_MINOR_VERSION[0] == 2
2930

3031

3132
if TYPE_CHECKING:

sqlmodel/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
from ._compat import ( # type: ignore[attr-defined]
5858
IS_PYDANTIC_V2,
59-
PYDANTIC_VERSION,
59+
PYDANTIC_MINOR_VERSION,
6060
BaseConfig,
6161
ModelField,
6262
ModelMetaclass,
@@ -341,7 +341,7 @@ def Field(
341341
regex: Optional[str] = None,
342342
discriminator: Optional[str] = None,
343343
repr: bool = True,
344-
sa_column: Union[Column, UndefinedType] = Undefined, # type: ignore
344+
sa_column: Union[Column[Any], UndefinedType] = Undefined,
345345
schema_extra: Optional[Dict[str, Any]] = None,
346346
) -> Any: ...
347347

@@ -874,7 +874,7 @@ def model_dump(
874874
warnings: Union[bool, Literal["none", "warn", "error"]] = True,
875875
serialize_as_any: bool = False,
876876
) -> Dict[str, Any]:
877-
if PYDANTIC_VERSION >= "2.7.0":
877+
if PYDANTIC_MINOR_VERSION >= (2, 7):
878878
extra_kwargs: Dict[str, Any] = {
879879
"context": context,
880880
"serialize_as_any": serialize_as_any,

0 commit comments

Comments
 (0)