Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mskrip authored Aug 9, 2024
2 parents b42b7bb + 3e0c184 commit f3cd7ec
Show file tree
Hide file tree
Showing 15 changed files with 277 additions and 80 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ jobs:
- docs/**
- docs_src/**
- requirements-docs.txt
- requirements-docs-insiders.txt
- pyproject.toml
- mkdocs.yml
- mkdocs.insiders.yml
- mkdocs.maybe-insiders.yml
- mkdocs.no-insiders.yml
- .github/workflows/build-docs.yml
- .github/workflows/deploy-docs.yml
Expand All @@ -53,16 +56,15 @@ jobs:
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt') }}-v01
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-insiders.txt', 'requirements-docs-tests.txt') }}-v02
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs.txt
- name: Install Material for MkDocs Insiders
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: |
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
pip install git+https://${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
run: pip install -r requirements-docs-insiders.txt
env:
TOKEN: ${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}
- uses: actions/cache@v4
with:
key: mkdocs-cards-${{ github.ref }}
Expand Down
37 changes: 23 additions & 14 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:
deployments: write
issues: write
pull-requests: write
statuses: write

jobs:
deploy-docs:
Expand All @@ -20,6 +21,25 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
- name: Install GitHub Actions dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-github-actions.txt
- name: Deploy Docs Status Pending
run: python ./scripts/deploy_docs_status.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_ID: ${{ github.run_id }}

- name: Clean site
run: |
rm -rf ./site
Expand All @@ -43,22 +63,11 @@ jobs:
directory: './site'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
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 ) }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
- name: Install GitHub Actions dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-github-actions.txt
- name: Comment Deploy
if: steps.deploy.outputs.url != ''
run: python ./scripts/comment_docs_deploy_url_in_pr.py
run: python ./scripts/deploy_docs_status.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEPLOY_URL: ${{ steps.deploy.outputs.url }}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_ID: ${{ github.run_id }}
IS_DONE: "true"
12 changes: 12 additions & 0 deletions .github/workflows/test-redistribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ jobs:
run: |
cd dist
pip wheel --no-deps sqlmodel*.tar.gz
# https://github.com/marketplace/actions/alls-green#why
test-redistribute-alls-green: # This job does nothing and is only used for the branch protection
if: always()
needs:
- test-redistribute
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
2 changes: 2 additions & 0 deletions docs/css/termynal.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
position: relative;
-webkit-box-sizing: border-box;
box-sizing: border-box;
/* Custom line-height */
line-height: 1.2;
}

[data-termynal]:before {
Expand Down
4 changes: 3 additions & 1 deletion docs/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,6 @@ async function main() {
setupTermynal()
}

main()
document$.subscribe(() => {
main()
})
5 changes: 5 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

### Internal

* 💄 Update Termynal line-height. PR [#1057](https://github.com/tiangolo/sqlmodel/pull/1057) by [@tiangolo](https://github.com/tiangolo).
* 👷 Upgrade build docs configs. PR [#1047](https://github.com/tiangolo/sqlmodel/pull/1047) by [@tiangolo](https://github.com/tiangolo).
* 👷 Add alls-green for test-redistribute. PR [#1055](https://github.com/tiangolo/sqlmodel/pull/1055) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update docs-previews to handle no docs changes. PR [#1056](https://github.com/tiangolo/sqlmodel/pull/1056) by [@tiangolo](https://github.com/tiangolo).
* 👷🏻 Show docs deployment status and preview URLs in comment. PR [#1054](https://github.com/tiangolo/sqlmodel/pull/1054) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Enable auto dark mode. PR [#1046](https://github.com/tiangolo/sqlmodel/pull/1046) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update issue-manager. PR [#1045](https://github.com/tiangolo/sqlmodel/pull/1045) by [@tiangolo](https://github.com/tiangolo).
* 👷 Update issue-manager.yml GitHub Action permissions. PR [#1040](https://github.com/tiangolo/sqlmodel/pull/1040) by [@tiangolo](https://github.com/tiangolo).
Expand Down
2 changes: 2 additions & 0 deletions docs/tutorial/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Intro, Installation, and First Steps

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. 🤓

## Type hints

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>.
Expand Down
6 changes: 5 additions & 1 deletion mkdocs.insiders.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins:
social:
typeset:
markdown_extensions:
material.extensions.preview:
targets:
include:
- ./*
89 changes: 71 additions & 18 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,43 @@ theme:
icon: material/lightbulb-outline
name: Switch to system preference
features:
- search.suggest
- search.highlight
- content.code.annotate
- content.code.copy
# - content.code.select
- content.footnote.tooltips
- content.tabs.link
- navigation.indexes
- content.tooltips
- navigation.footer
- navigation.indexes
- navigation.instant
- navigation.instant.prefetch
- navigation.instant.preview
- navigation.instant.progress
- navigation.path
- content.code.annotate
- content.code.copy
- content.code.select
# - navigation.tabs
# - navigation.tabs.sticky
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow

icon:
repo: fontawesome/brands/github-alt
logo: img/icon-white.svg
favicon: img/favicon.png
language: en
repo_name: tiangolo/sqlmodel
repo_url: https://github.com/tiangolo/sqlmodel
edit_uri: ''
plugins:
search: null
markdownextradata:
data: ./data
# Material for MkDocs
search:
social:
# Other plugins
macros:
include_yaml:
- sponsors: data/sponsors.yml

nav:
- SQLModel: index.md
Expand Down Expand Up @@ -113,33 +128,68 @@ nav:
- release-notes.md

markdown_extensions:
markdown.extensions.attr_list:
markdown.extensions.tables:
markdown.extensions.md_in_html:
# Python Markdown
abbr:
attr_list:
footnotes:
md_in_html:
tables:
toc:
permalink: true

# Python Markdown Extensions
pymdownx.betterem:
smart_enable: all
pymdownx.caret:
pymdownx.highlight:
line_spans: __span
pymdownx.inlinehilite:
pymdownx.keys:
pymdownx.mark:
pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format ''
pymdownx.betterem:
pymdownx.blocks.details:
format: !!python/name:pymdownx.superfences.fence_code_format
pymdownx.tilde:

# pymdownx blocks
pymdownx.blocks.admonition:
types:
- note
- info
- attention
- caution
- danger
- error
- tip
- hint
- warning
- danger
# Custom types
- info
pymdownx.blocks.details:
pymdownx.blocks.tab:
alternate_style: True

# Other extensions
mdx_include:

extra:
analytics:
provider: google
property: G-J8HVTT936W
feedback:
title: Was this page helpful?
ratings:
- icon: material/emoticon-happy-outline
name: This page was helpful
data: 1
note: >-
Thanks for your feedback!
- icon: material/emoticon-sad-outline
name: This page could be improved
data: 0
note: >-
Thanks for your feedback!
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/tiangolo/sqlmodel
Expand All @@ -161,3 +211,6 @@ extra_css:
extra_javascript:
- js/termynal.js
- js/custom.js

hooks:
- scripts/mkdocs_hooks.py
3 changes: 3 additions & 0 deletions requirements-docs-insiders.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
git+https://${TOKEN}@github.com/squidfunk/[email protected]
git+https://${TOKEN}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
git+https://${TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git
10 changes: 5 additions & 5 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
-e .
-r requirements-docs-tests.txt
mkdocs-material==9.4.7
mkdocs-material==9.5.18
mdx-include >=1.4.1,<2.0.0
mkdocs-markdownextradata-plugin >=0.1.7,<0.3.0
mkdocs-redirects>=1.2.1,<1.3.0
pyyaml >=5.3.1,<7.0.0
# For Material for MkDocs, Chinese search
jieba==0.42.1
# jieba==0.42.1
# For image processing by Material for MkDocs
pillow==10.1.0
pillow==10.3.0
# For image processing by Material for MkDocs
cairosvg==2.7.1
mkdocstrings[python]==0.25.1
# mkdocstrings[python]==0.25.1
# Enable griffe-typingdoc once dropping Python 3.7 and upgrading typing-extensions
# griffe-typingdoc==0.2.5
# For griffe, it formats with black
typer == 0.12.3
mkdocs-macros-plugin==1.0.5
31 changes: 0 additions & 31 deletions scripts/comment_docs_deploy_url_in_pr.py

This file was deleted.

Loading

0 comments on commit f3cd7ec

Please sign in to comment.