Skip to content

Commit c7629d2

Browse files
committed
refactor: consolidate docs workflows and cleanup
- Merge docs-dev.yaml and docs-test.yaml into single docs.yaml - Update migration tasks to remove more obsolete files - Improve type annotations in __builtins__.pyi - Remove unused pre-release workflow from release.yaml
1 parent 0eab90b commit c7629d2

8 files changed

Lines changed: 44 additions & 96 deletions

File tree

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"ipython",
1919
"libc",
2020
"liblaf",
21+
"mathjax",
2122
"mkdocs",
2223
"mkdocstrings",
2324
"mypy",

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"yaml.customTags": [
3+
// ref: <https://squidfunk.github.io/mkdocs-material/creating-your-site/#minimal-configuration>
34
"!ENV scalar",
45
"!ENV sequence",
56
"!relative scalar",

copier.yaml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ _answers_file: .config/copier/.copier-answers.python.yaml
77
_external_data:
88
shared: "{{ answers_file_shared }}"
99

10-
_migrations:
10+
_migrations: &migrations
1111
- rm --force --verbose ".config/copier/direnv/00-python.sh"
1212
- rm --force --verbose ".config/copier/mise/scripts/setup-python.sh"
1313
- rm --force --verbose ".config/copier/python.just"
@@ -16,18 +16,25 @@ _migrations:
1616
- rm --force --verbose ".github/copier/mkdocs.yaml"
1717
- rm --force --verbose ".github/linters/.ruff.toml"
1818
- rm --force --verbose ".github/linters/pyrightconfig.json"
19+
- rm --force --verbose ".github/workflows/docs-dev.yaml"
1920
- rm --force --verbose ".github/workflows/docs-stable.yaml"
20-
- rm --force --verbose ".github/workflows/docs.yaml"
21+
- rm --force --verbose ".github/workflows/docs-test.yaml"
2122
- rm --force --verbose ".github/workflows/shared-docs.yaml"
2223
- rm --force --verbose ".github/workflows/shared-release.yaml"
24+
- rm --force --verbose "docs/css/fonts.css"
25+
- rm --force --verbose "docs/css/mkdocstrings/api-autonav.css"
26+
- rm --force --verbose "docs/css/mkdocstrings/material.css"
27+
- rm --force --verbose "docs/css/mkdocstrings/syntax-highlight-in-signatures.css"
28+
- rm --force --verbose "docs/javascript/mathjax.js"
29+
- rm --force --verbose "docs/scripts/gen-ref-pages.py"
30+
- rm --force --verbose "docs/SUMMARY.md"
2331

2432
_skip_if_exists:
2533
- .config/mise/config.toml
2634
- .gitignore
2735
- .ruff.toml
2836
- .vscode/settings.json
2937
- docs/README.md
30-
- docs/SUMMARY.md
3138
- mkdocs.yaml
3239
- pyproject.toml
3340
- pyrightconfig.json
@@ -39,19 +46,7 @@ _skip_if_exists:
3946

4047
_subdirectory: template
4148

42-
_tasks:
43-
- rm --force --verbose ".config/copier/direnv/00-python.sh"
44-
- rm --force --verbose ".config/copier/mise/scripts/setup-python.sh"
45-
- rm --force --verbose ".config/copier/python.just"
46-
- rm --force --verbose ".config/mise/conf.d/00-python.toml"
47-
- rm --force --verbose ".github/copier/.copier-answers.python.yaml"
48-
- rm --force --verbose ".github/copier/mkdocs.yaml"
49-
- rm --force --verbose ".github/linters/.ruff.toml"
50-
- rm --force --verbose ".github/linters/pyrightconfig.json"
51-
- rm --force --verbose ".github/workflows/docs-stable.yaml"
52-
- rm --force --verbose ".github/workflows/docs.yaml"
53-
- rm --force --verbose ".github/workflows/shared-docs.yaml"
54-
- rm --force --verbose ".github/workflows/shared-release.yaml"
49+
_tasks: *migrations
5550

5651
answers_file_shared:
5752
type: str

template/.github/workflows/docs-test.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This file is @generated by <https://github.com/liblaf/copier-python>.
22
# DO NOT EDIT!
33

4-
name: Docs (Dev)
5-
4+
name: Docs
65
on:
76
push:
8-
branches:
9-
- main
7+
branches-ignore:
8+
- assets**
9+
- gh-pages
1010
workflow_dispatch:
1111

1212
jobs:
@@ -32,9 +32,14 @@ jobs:
3232
- if: hashFiles('docs/scripts/pre-build.sh') != ''
3333
name: Pre-Build
3434
run: docs/scripts/pre-build.sh
35-
- name: Deploy
35+
- if: ${{ github.ref != 'refs/heads/main' }}
36+
name: Build
37+
run: mkdocs build
38+
- if: ${{ github.ref == 'refs/heads/main' }}
39+
name: Deploy
3640
run: mkdocs gh-deploy --force --no-history
37-
- name: Setup GitHub Pages
41+
- if: ${{ github.ref == 'refs/heads/main' }}
42+
name: Setup GitHub Pages
3843
uses: liblaf/actions/setup-pages@main
3944
with:
4045
token: ${{ secrets.GH_PAT || steps.auth.outputs.token }}

template/.github/workflows/release.yaml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
name: Release
55

66
on:
7-
push:
8-
branches-ignore:
9-
- assets**
10-
- gh-pages
117
release:
128
types:
139
- published
@@ -46,42 +42,6 @@ jobs:
4642
- name: Publish to PyPI
4743
uses: pypa/gh-action-pypi-publish@release/v1
4844

49-
pre-release:
50-
name: Pre-Release
51-
permissions:
52-
contents: write
53-
needs:
54-
- build
55-
if: github.ref == 'refs/heads/main'
56-
runs-on: ubuntu-latest
57-
concurrency:
58-
group: ${{ github.workflow }}-${{ github.ref }}-pre-release
59-
cancel-in-progress: true
60-
steps:
61-
- id: auth
62-
name: Auth App
63-
uses: liblaf/actions/auth-app@main
64-
with:
65-
app-id: ${{ secrets.GH_APP_ID }}
66-
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
67-
- name: Checkout
68-
uses: actions/checkout@v4
69-
with:
70-
fetch-depth: 0
71-
- name: Download Artifacts
72-
uses: actions/download-artifact@v4
73-
with:
74-
name: ${{ needs.build.outputs.artifact-name }}
75-
path: dist/
76-
- name: Create Pre-Release
77-
uses: liblaf/actions/release@main
78-
with:
79-
clobber: true
80-
files: dist/*
81-
prerelease: true
82-
tag: dev
83-
token: ${{ steps.auth.outputs.token }}
84-
8545
release:
8646
name: Release
8747
permissions:

template/.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"python.testing.pytestEnabled": true,
2020
"python.testing.unittestEnabled": false,
2121
"yaml.customTags": [
22+
// ref: <https://squidfunk.github.io/mkdocs-material/creating-your-site/#minimal-configuration>
2223
"!ENV scalar",
2324
"!ENV sequence",
2425
"!relative scalar",

template/__builtins__.pyi

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# This file is @generated by <https://github.com/liblaf/copier-python>.
2+
# DO NOT EDIT!
3+
14
# ref: <https://github.com/microsoft/pyright/blob/main/docs/builtins.md>
25

3-
from icecream import ic as ic
6+
from typing import overload, type_check_only
7+
8+
@type_check_only
9+
class _IceCreamDebugger:
10+
@overload
11+
def __call__(self) -> None: ...
12+
@overload
13+
def __call__[T](self, arg: T) -> T: ...
14+
@overload
15+
def __call__[T1, T2, *Ts](
16+
self, arg1: T1, arg2: T2, *args: *Ts
17+
) -> tuple[T1, T2, *Ts]: ...
18+
19+
ic: _IceCreamDebugger
20+
21+
__all__ = ["ic"]

0 commit comments

Comments
 (0)