Skip to content

Commit 0ac4566

Browse files
authored
Merge branch 'main' into main
2 parents 2534099 + ce22f2a commit 0ac4566

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+287
-10684
lines changed

.github/workflows/build-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
- mkdocs.no-insiders.yml
4242
- .github/workflows/build-docs.yml
4343
- .github/workflows/deploy-docs.yml
44+
- data/**
4445
4546
build-docs:
4647
needs:
@@ -58,7 +59,7 @@ jobs:
5859
with:
5960
python-version: "3.11"
6061
- name: Setup uv
61-
uses: astral-sh/setup-uv@v3
62+
uses: astral-sh/setup-uv@v5
6263
with:
6364
version: "0.4.15"
6465
enable-cache: true

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
python-version: "3.11"
3131
- name: Setup uv
32-
uses: astral-sh/setup-uv@v3
32+
uses: astral-sh/setup-uv@v5
3333
with:
3434
version: "0.4.15"
3535
enable-cache: true

.github/workflows/latest-changes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
3131
with:
3232
limit-access-to-actor: true
33-
- uses: tiangolo/[email protected].1
33+
- uses: tiangolo/[email protected].2
3434
with:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
latest_changes_file: docs/release-notes.md

.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.9.0
37+
uses: pypa/gh-action-pypi-publish@v1.12.3

.github/workflows/smokeshow.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
python-version: '3.9'
2323
- name: Setup uv
24-
uses: astral-sh/setup-uv@v3
24+
uses: astral-sh/setup-uv@v5
2525
with:
2626
version: "0.4.15"
2727
enable-cache: true
@@ -35,7 +35,17 @@ jobs:
3535
path: htmlcov
3636
github-token: ${{ secrets.GITHUB_TOKEN }}
3737
run-id: ${{ github.event.workflow_run.id }}
38-
- run: smokeshow upload htmlcov
38+
# Try 5 times to upload coverage to smokeshow
39+
- name: Upload coverage to Smokeshow
40+
run: |
41+
for i in 1 2 3 4 5; do
42+
if smokeshow upload htmlcov; then
43+
echo "Smokeshow upload success!"
44+
break
45+
fi
46+
echo "Smokeshow upload error, sleep 1 sec and try again."
47+
sleep 1
48+
done
3949
env:
4050
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
4151
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 95

.github/workflows/test.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ env:
2323

2424
jobs:
2525
test:
26-
runs-on: ubuntu-latest
2726
strategy:
2827
matrix:
28+
os: [ ubuntu-latest ]
2929
python-version:
30-
- "3.7"
3130
- "3.8"
3231
- "3.9"
3332
- "3.10"
@@ -36,15 +35,23 @@ jobs:
3635
pydantic-version:
3736
- pydantic-v1
3837
- pydantic-v2
38+
include:
39+
- os: ubuntu-22.04
40+
python-version: "3.7"
41+
pydantic-version: pydantic-v1
42+
- os: ubuntu-22.04
43+
python-version: "3.7"
44+
pydantic-version: pydantic-v2
3945
fail-fast: false
46+
runs-on: ${{ matrix.os }}
4047
steps:
4148
- uses: actions/checkout@v4
4249
- name: Set up Python
4350
uses: actions/setup-python@v5
4451
with:
4552
python-version: ${{ matrix.python-version }}
4653
- name: Setup uv
47-
uses: astral-sh/setup-uv@v3
54+
uses: astral-sh/setup-uv@v5
4855
with:
4956
version: "0.4.15"
5057
enable-cache: true
@@ -92,7 +99,7 @@ jobs:
9299
with:
93100
python-version: '3.12'
94101
- name: Setup uv
95-
uses: astral-sh/setup-uv@v3
102+
uses: astral-sh/setup-uv@v5
96103
with:
97104
version: "0.4.15"
98105
enable-cache: true

data/members.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
members:
22
- login: tiangolo
3-
- login: estebanx64
43
- login: alejsdev

docs/advanced/decimal.md

Lines changed: 3 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,7 @@ For the database, **SQLModel** will use <a href="https://docs.sqlalchemy.org/en/
3333

3434
Let's say that each hero in the database will have an amount of money. We could make that field a `Decimal` type using the `condecimal()` function:
3535

36-
//// tab | Python 3.10+
37-
38-
```python hl_lines="11"
39-
{!./docs_src/advanced/decimal/tutorial001_py310.py[ln:1-11]!}
40-
41-
# More code here later 👇
42-
```
43-
44-
////
45-
46-
//// tab | Python 3.7+
47-
48-
```python hl_lines="12"
49-
{!./docs_src/advanced/decimal/tutorial001.py[ln:1-12]!}
50-
51-
# More code here later 👇
52-
```
53-
54-
////
55-
56-
/// details | 👀 Full file preview
57-
58-
//// tab | Python 3.10+
59-
60-
```Python
61-
{!./docs_src/advanced/decimal/tutorial001_py310.py!}
62-
```
63-
64-
////
65-
66-
//// tab | Python 3.7+
67-
68-
```Python
69-
{!./docs_src/advanced/decimal/tutorial001.py!}
70-
```
71-
72-
////
73-
74-
///
36+
{* ./docs_src/advanced/decimal/tutorial001_py310.py ln[1:11] hl[11] *}
7537

7638
Here we are saying that `money` can have at most `5` digits with `max_digits`, **this includes the integers** (to the left of the decimal dot) **and the decimals** (to the right of the decimal dot).
7739

@@ -105,97 +67,13 @@ Make sure you adjust the number of digits and decimal places for your own needs,
10567

10668
When creating new models you can actually pass normal (`float`) numbers, Pydantic will automatically convert them to `Decimal` types, and **SQLModel** will store them as `Decimal` types in the database (using SQLAlchemy).
10769

108-
//// tab | Python 3.10+
109-
110-
```Python hl_lines="4-6"
111-
# Code above omitted 👆
112-
113-
{!./docs_src/advanced/decimal/tutorial001_py310.py[ln:24-34]!}
114-
115-
# Code below omitted 👇
116-
```
117-
118-
////
119-
120-
//// tab | Python 3.7+
121-
122-
```Python hl_lines="4-6"
123-
# Code above omitted 👆
124-
125-
{!./docs_src/advanced/decimal/tutorial001.py[ln:25-35]!}
126-
127-
# Code below omitted 👇
128-
```
129-
130-
////
131-
132-
/// details | 👀 Full file preview
133-
134-
//// tab | Python 3.10+
135-
136-
```Python
137-
{!./docs_src/advanced/decimal/tutorial001_py310.py!}
138-
```
139-
140-
////
141-
142-
//// tab | Python 3.7+
143-
144-
```Python
145-
{!./docs_src/advanced/decimal/tutorial001.py!}
146-
```
147-
148-
////
149-
150-
///
70+
{* ./docs_src/advanced/decimal/tutorial001_py310.py ln[24:34] hl[25:27] *}
15171

15272
## Select Decimal data
15373

15474
Then, when working with Decimal types, you can confirm that they indeed avoid those rounding errors from floats:
15575

156-
//// tab | Python 3.10+
157-
158-
```Python hl_lines="15-16"
159-
# Code above omitted 👆
160-
161-
{!./docs_src/advanced/decimal/tutorial001_py310.py[ln:37-50]!}
162-
163-
# Code below omitted 👇
164-
```
165-
166-
////
167-
168-
//// tab | Python 3.7+
169-
170-
```Python hl_lines="15-16"
171-
# Code above omitted 👆
172-
173-
{!./docs_src/advanced/decimal/tutorial001.py[ln:38-51]!}
174-
175-
# Code below omitted 👇
176-
```
177-
178-
////
179-
180-
/// details | 👀 Full file preview
181-
182-
//// tab | Python 3.10+
183-
184-
```Python
185-
{!./docs_src/advanced/decimal/tutorial001_py310.py!}
186-
```
187-
188-
////
189-
190-
//// tab | Python 3.7+
191-
192-
```Python
193-
{!./docs_src/advanced/decimal/tutorial001.py!}
194-
```
195-
196-
////
197-
198-
///
76+
{* ./docs_src/advanced/decimal/tutorial001_py310.py ln[37:50] hl[49:50] *}
19977

20078
## Review the results
20179

docs/databases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ There are many databases of many types.
6666

6767
### A single file database
6868

69-
A database could be a single file called `heroes.db`, managed with code in a very efficient way. An example would be SQLite, more about that on a bit.
69+
A database could be a single file called `heroes.db`, managed with code in a very efficient way. An example would be SQLite, more about that in a bit.
7070

7171
![database as a single file](img/databases/single-file.svg)
7272

docs/release-notes.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
### Docs
1010

11+
* ✏️ Fix typo in `databases.md`. PR [#1113](https://github.com/fastapi/sqlmodel/pull/1113) by [@radi-dev](https://github.com/radi-dev).
12+
* ✏️ 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).
13+
* ✏️ Fix typo in `insert.md`. PR [#1256](https://github.com/fastapi/sqlmodel/pull/1256) by [@Noushadaliam](https://github.com/Noushadaliam).
14+
* 📝 Update markdown includes format. PR [#1254](https://github.com/fastapi/sqlmodel/pull/1254) by [@tiangolo](https://github.com/tiangolo).
15+
* 📝 Update fenced code in Decimal docs for consistency. PR [#1251](https://github.com/fastapi/sqlmodel/pull/1251) by [@tiangolo](https://github.com/tiangolo).
16+
* ✏️ Fix typo in the release notes of v0.0.22. PR [#1195](https://github.com/fastapi/sqlmodel/pull/1195) by [@PipeKnight](https://github.com/PipeKnight).
1117
* 📝 Update includes for `docs/advanced/uuid.md`. PR [#1151](https://github.com/fastapi/sqlmodel/pull/1151) by [@tiangolo](https://github.com/tiangolo).
1218
* 📝 Update includes for `docs/tutorial/create-db-and-table.md`. PR [#1149](https://github.com/fastapi/sqlmodel/pull/1149) by [@tiangolo](https://github.com/tiangolo).
1319
* 📝 Fix internal links in docs. PR [#1148](https://github.com/fastapi/sqlmodel/pull/1148) by [@tiangolo](https://github.com/tiangolo).
@@ -16,6 +22,18 @@
1622

1723
### Internal
1824

25+
* 💚 Fix CI test suite for Python 3.7. PR [#1309](https://github.com/fastapi/sqlmodel/pull/1309) by [@svlandeg](https://github.com/svlandeg).
26+
* 👷 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).
27+
* 👷 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).
28+
* 👷 Add retries to Smokeshow. PR [#1302](https://github.com/fastapi/sqlmodel/pull/1302) by [@svlandeg](https://github.com/svlandeg).
29+
* ⬆ Bump astral-sh/setup-uv from 4 to 5. PR [#1249](https://github.com/fastapi/sqlmodel/pull/1249) by [@dependabot[bot]](https://github.com/apps/dependabot).
30+
* ⬆ Bump pillow from 10.3.0 to 11.0.0. PR [#1139](https://github.com/fastapi/sqlmodel/pull/1139) by [@dependabot[bot]](https://github.com/apps/dependabot).
31+
* ⬆ Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.12.3. PR [#1240](https://github.com/fastapi/sqlmodel/pull/1240) by [@dependabot[bot]](https://github.com/apps/dependabot).
32+
* ⬆ Bump astral-sh/setup-uv from 3 to 4. PR [#1225](https://github.com/fastapi/sqlmodel/pull/1225) by [@dependabot[bot]](https://github.com/apps/dependabot).
33+
* ⬆ Bump tiangolo/latest-changes from 0.3.1 to 0.3.2. PR [#1207](https://github.com/fastapi/sqlmodel/pull/1207) by [@dependabot[bot]](https://github.com/apps/dependabot).
34+
* 🔨 Update docs previews script. PR [#1236](https://github.com/fastapi/sqlmodel/pull/1236) by [@tiangolo](https://github.com/tiangolo).
35+
* 🔧 Update build-docs filter paths. PR [#1235](https://github.com/fastapi/sqlmodel/pull/1235) by [@tiangolo](https://github.com/tiangolo).
36+
* 🔧 Update team members. PR [#1234](https://github.com/fastapi/sqlmodel/pull/1234) by [@tiangolo](https://github.com/tiangolo).
1937
* ⬆️ Upgrade markdown-include-variants to version 0.0.3. PR [#1152](https://github.com/fastapi/sqlmodel/pull/1152) by [@tiangolo](https://github.com/tiangolo).
2038
* 👷 Update issue manager workflow. PR [#1137](https://github.com/fastapi/sqlmodel/pull/1137) by [@alejsdev](https://github.com/alejsdev).
2139
* 👷 Fix smokeshow, checkout files on CI. PR [#1136](https://github.com/fastapi/sqlmodel/pull/1136) by [@tiangolo](https://github.com/tiangolo).
@@ -36,7 +54,7 @@
3654

3755
### Fixes
3856

39-
* 🐛 Fix support for types with `Optional[Annoated[x, f()]]`, e.g. `id: Optional[pydantic.UUID4]`. PR [#1093](https://github.com/fastapi/sqlmodel/pull/1093) by [@tiangolo](https://github.com/tiangolo).
57+
* 🐛 Fix support for types with `Optional[Annotated[x, f()]]`, e.g. `id: Optional[pydantic.UUID4]`. PR [#1093](https://github.com/fastapi/sqlmodel/pull/1093) by [@tiangolo](https://github.com/tiangolo).
4058

4159
### Docs
4260

0 commit comments

Comments
 (0)