Skip to content

Commit f3cd7ec

Browse files
authored
Merge branch 'main' into main
2 parents b42b7bb + 3e0c184 commit f3cd7ec

15 files changed

+277
-80
lines changed

.github/workflows/build-docs.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ jobs:
2828
- docs/**
2929
- docs_src/**
3030
- requirements-docs.txt
31+
- requirements-docs-insiders.txt
3132
- pyproject.toml
3233
- mkdocs.yml
3334
- mkdocs.insiders.yml
35+
- mkdocs.maybe-insiders.yml
36+
- mkdocs.no-insiders.yml
3437
- .github/workflows/build-docs.yml
3538
- .github/workflows/deploy-docs.yml
3639
@@ -53,16 +56,15 @@ jobs:
5356
id: cache
5457
with:
5558
path: ${{ env.pythonLocation }}
56-
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt') }}-v01
59+
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-insiders.txt', 'requirements-docs-tests.txt') }}-v02
5760
- name: Install docs extras
5861
if: steps.cache.outputs.cache-hit != 'true'
5962
run: pip install -r requirements-docs.txt
6063
- name: Install Material for MkDocs Insiders
6164
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
62-
run: |
63-
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
64-
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
65-
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
65+
run: pip install -r requirements-docs-insiders.txt
66+
env:
67+
TOKEN: ${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}
6668
- uses: actions/cache@v4
6769
with:
6870
key: mkdocs-cards-${{ github.ref }}

.github/workflows/deploy-docs.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
deployments: write
1111
issues: write
1212
pull-requests: write
13+
statuses: write
1314

1415
jobs:
1516
deploy-docs:
@@ -20,6 +21,25 @@ jobs:
2021
GITHUB_CONTEXT: ${{ toJson(github) }}
2122
run: echo "$GITHUB_CONTEXT"
2223
- uses: actions/checkout@v4
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.11"
28+
- uses: actions/cache@v4
29+
id: cache
30+
with:
31+
path: ${{ env.pythonLocation }}
32+
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
33+
- name: Install GitHub Actions dependencies
34+
if: steps.cache.outputs.cache-hit != 'true'
35+
run: pip install -r requirements-github-actions.txt
36+
- name: Deploy Docs Status Pending
37+
run: python ./scripts/deploy_docs_status.py
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
41+
RUN_ID: ${{ github.run_id }}
42+
2343
- name: Clean site
2444
run: |
2545
rm -rf ./site
@@ -43,22 +63,11 @@ jobs:
4363
directory: './site'
4464
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
4565
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'main' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
46-
- name: Set up Python
47-
uses: actions/setup-python@v5
48-
with:
49-
python-version: "3.11"
50-
- uses: actions/cache@v4
51-
id: cache
52-
with:
53-
path: ${{ env.pythonLocation }}
54-
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
55-
- name: Install GitHub Actions dependencies
56-
if: steps.cache.outputs.cache-hit != 'true'
57-
run: pip install -r requirements-github-actions.txt
5866
- name: Comment Deploy
59-
if: steps.deploy.outputs.url != ''
60-
run: python ./scripts/comment_docs_deploy_url_in_pr.py
67+
run: python ./scripts/deploy_docs_status.py
6168
env:
6269
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6370
DEPLOY_URL: ${{ steps.deploy.outputs.url }}
6471
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
72+
RUN_ID: ${{ github.run_id }}
73+
IS_DONE: "true"

.github/workflows/test-redistribute.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,15 @@ jobs:
5151
run: |
5252
cd dist
5353
pip wheel --no-deps sqlmodel*.tar.gz
54+
55+
# https://github.com/marketplace/actions/alls-green#why
56+
test-redistribute-alls-green: # This job does nothing and is only used for the branch protection
57+
if: always()
58+
needs:
59+
- test-redistribute
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Decide whether the needed jobs succeeded or failed
63+
uses: re-actors/alls-green@release/v1
64+
with:
65+
jobs: ${{ toJSON(needs) }}

docs/css/termynal.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
position: relative;
2727
-webkit-box-sizing: border-box;
2828
box-sizing: border-box;
29+
/* Custom line-height */
30+
line-height: 1.2;
2931
}
3032

3133
[data-termynal]:before {

docs/js/custom.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,6 @@ async function main() {
110110
setupTermynal()
111111
}
112112

113-
main()
113+
document$.subscribe(() => {
114+
main()
115+
})

docs/release-notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
### Internal
1010

11+
* 💄 Update Termynal line-height. PR [#1057](https://github.com/tiangolo/sqlmodel/pull/1057) by [@tiangolo](https://github.com/tiangolo).
12+
* 👷 Upgrade build docs configs. PR [#1047](https://github.com/tiangolo/sqlmodel/pull/1047) by [@tiangolo](https://github.com/tiangolo).
13+
* 👷 Add alls-green for test-redistribute. PR [#1055](https://github.com/tiangolo/sqlmodel/pull/1055) by [@tiangolo](https://github.com/tiangolo).
14+
* 👷 Update docs-previews to handle no docs changes. PR [#1056](https://github.com/tiangolo/sqlmodel/pull/1056) by [@tiangolo](https://github.com/tiangolo).
15+
* 👷🏻 Show docs deployment status and preview URLs in comment. PR [#1054](https://github.com/tiangolo/sqlmodel/pull/1054) by [@tiangolo](https://github.com/tiangolo).
1116
* 🔧 Enable auto dark mode. PR [#1046](https://github.com/tiangolo/sqlmodel/pull/1046) by [@tiangolo](https://github.com/tiangolo).
1217
* 👷 Update issue-manager. PR [#1045](https://github.com/tiangolo/sqlmodel/pull/1045) by [@tiangolo](https://github.com/tiangolo).
1318
* 👷 Update issue-manager.yml GitHub Action permissions. PR [#1040](https://github.com/tiangolo/sqlmodel/pull/1040) by [@tiangolo](https://github.com/tiangolo).

docs/tutorial/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Intro, Installation, and First Steps
22

3+
Before we start playing with **SQLModel**, let's prepare everything else we need. A bit of type annotations, setting up the environment to install everything, and installing DB Browser for SQLite. 🤓
4+
35
## Type hints
46

57
If you need a refresher about how to use Python type hints (type annotations), check <a href="https://fastapi.tiangolo.com/python-types/" class="external-link" target="_blank">FastAPI's Python types intro</a>.

mkdocs.insiders.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
plugins:
2-
social:
32
typeset:
3+
markdown_extensions:
4+
material.extensions.preview:
5+
targets:
6+
include:
7+
- ./*

mkdocs.yml

Lines changed: 71 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,43 @@ theme:
2525
icon: material/lightbulb-outline
2626
name: Switch to system preference
2727
features:
28-
- search.suggest
29-
- search.highlight
28+
- content.code.annotate
29+
- content.code.copy
30+
# - content.code.select
31+
- content.footnote.tooltips
3032
- content.tabs.link
31-
- navigation.indexes
3233
- content.tooltips
34+
- navigation.footer
35+
- navigation.indexes
36+
- navigation.instant
37+
- navigation.instant.prefetch
38+
- navigation.instant.preview
39+
- navigation.instant.progress
3340
- navigation.path
34-
- content.code.annotate
35-
- content.code.copy
36-
- content.code.select
3741
# - navigation.tabs
42+
# - navigation.tabs.sticky
43+
- navigation.top
44+
- navigation.tracking
45+
- search.highlight
46+
- search.share
47+
- search.suggest
48+
- toc.follow
49+
3850
icon:
3951
repo: fontawesome/brands/github-alt
4052
logo: img/icon-white.svg
4153
favicon: img/favicon.png
4254
language: en
4355
repo_name: tiangolo/sqlmodel
4456
repo_url: https://github.com/tiangolo/sqlmodel
45-
edit_uri: ''
4657
plugins:
47-
search: null
48-
markdownextradata:
49-
data: ./data
58+
# Material for MkDocs
59+
search:
60+
social:
61+
# Other plugins
62+
macros:
63+
include_yaml:
64+
- sponsors: data/sponsors.yml
5065

5166
nav:
5267
- SQLModel: index.md
@@ -113,33 +128,68 @@ nav:
113128
- release-notes.md
114129

115130
markdown_extensions:
116-
markdown.extensions.attr_list:
117-
markdown.extensions.tables:
118-
markdown.extensions.md_in_html:
131+
# Python Markdown
132+
abbr:
133+
attr_list:
134+
footnotes:
135+
md_in_html:
136+
tables:
119137
toc:
120138
permalink: true
139+
140+
# Python Markdown Extensions
141+
pymdownx.betterem:
142+
smart_enable: all
143+
pymdownx.caret:
144+
pymdownx.highlight:
145+
line_spans: __span
146+
pymdownx.inlinehilite:
147+
pymdownx.keys:
148+
pymdownx.mark:
121149
pymdownx.superfences:
122150
custom_fences:
123151
- name: mermaid
124152
class: mermaid
125-
format: !!python/name:pymdownx.superfences.fence_code_format ''
126-
pymdownx.betterem:
127-
pymdownx.blocks.details:
153+
format: !!python/name:pymdownx.superfences.fence_code_format
154+
pymdownx.tilde:
155+
156+
# pymdownx blocks
128157
pymdownx.blocks.admonition:
129158
types:
130159
- note
131-
- info
160+
- attention
161+
- caution
162+
- danger
163+
- error
132164
- tip
165+
- hint
133166
- warning
134-
- danger
167+
# Custom types
168+
- info
169+
pymdownx.blocks.details:
135170
pymdownx.blocks.tab:
136171
alternate_style: True
172+
173+
# Other extensions
137174
mdx_include:
138175

139176
extra:
140177
analytics:
141178
provider: google
142179
property: G-J8HVTT936W
180+
feedback:
181+
title: Was this page helpful?
182+
ratings:
183+
- icon: material/emoticon-happy-outline
184+
name: This page was helpful
185+
data: 1
186+
note: >-
187+
Thanks for your feedback!
188+
- icon: material/emoticon-sad-outline
189+
name: This page could be improved
190+
data: 0
191+
note: >-
192+
Thanks for your feedback!
143193
social:
144194
- icon: fontawesome/brands/github-alt
145195
link: https://github.com/tiangolo/sqlmodel
@@ -161,3 +211,6 @@ extra_css:
161211
extra_javascript:
162212
- js/termynal.js
163213
- js/custom.js
214+
215+
hooks:
216+
- scripts/mkdocs_hooks.py

requirements-docs-insiders.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git+https://${TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git@9.5.30-insiders-4.53.11
2+
git+https://${TOKEN}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
3+
git+https://${TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git

0 commit comments

Comments
 (0)