Skip to content

Commit 16ce4e5

Browse files
committed
Merge branch 'master' into fix/rich_none
2 parents 01fef55 + 142422a commit 16ce4e5

85 files changed

Lines changed: 2934 additions & 1586 deletions

Some content is hidden

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

.github/actions/comment-docs-preview-in-pr/Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/actions/comment-docs-preview-in-pr/action.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/actions/comment-docs-preview-in-pr/app/main.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/build-docs.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
uses: actions/setup-python@v5
5050
with:
5151
python-version: "3.11"
52-
- uses: actions/cache@v3
52+
- uses: actions/cache@v4
5353
id: cache
5454
with:
5555
path: ${{ env.pythonLocation }}
@@ -63,17 +63,14 @@ jobs:
6363
pip install git+https://${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
6464
pip install git+https://${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
6565
pip install git+https://${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
66-
- uses: actions/cache@v3
66+
- uses: actions/cache@v4
6767
with:
6868
key: mkdocs-cards-${{ github.ref }}-v1
6969
path: .cache
70+
- name: Verify README
71+
run: python ./scripts/docs.py verify-readme
7072
- name: Build Docs
71-
if: github.event_name == 'pull_request' && github.secret_source != 'Actions'
72-
run: python -m mkdocs build
73-
- name: Build Docs with Insiders
74-
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
75-
run: python -m mkdocs build --config-file mkdocs.insiders.yml
76-
73+
run: python ./scripts/docs.py build
7774
- uses: actions/upload-artifact@v4
7875
with:
7976
name: docs-site

.github/workflows/deploy-docs.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
deployments: write
11+
issues: write
12+
pull-requests: write
13+
914
jobs:
1015
deploy-docs:
1116
runs-on: ubuntu-latest
@@ -38,9 +43,22 @@ jobs:
3843
directory: './site'
3944
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
4045
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && '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
4158
- name: Comment Deploy
4259
if: steps.deploy.outputs.url != ''
43-
uses: ./.github/actions/comment-docs-preview-in-pr
44-
with:
45-
token: ${{ secrets.GITHUB_TOKEN }}
46-
deploy_url: "${{ steps.deploy.outputs.url }}"
60+
run: python ./scripts/comment_docs_deploy_url_in_pr.py
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
DEPLOY_URL: ${{ steps.deploy.outputs.url }}
64+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}

.github/workflows/issue-manager.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
- labeled
1515
workflow_dispatch:
1616

17+
permissions:
18+
issues: write
19+
1720
jobs:
1821
issue-manager:
1922
if: github.repository_owner == 'tiangolo'

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
# Issue ref: https://github.com/actions/setup-python/issues/436
4545
# cache: "pip"
4646
# cache-dependency-path: pyproject.toml
47-
- uses: actions/cache@v3
47+
- uses: actions/cache@v4
4848
if: ${{ runner.os != 'macOS' }}
4949
id: cache
5050
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ htmlcov
1212
.pytest_cache
1313
coverage.xml
1414
.coverage*
15+
.cache

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<p align="center">
2-
<a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" alt="Typer"></a>
2+
<a href="https://typer.tiangolo.com"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg#only-light" alt="Typer"></a>
3+
34
</p>
45
<p align="center">
56
<em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>

docs/alternatives.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,33 @@ There have been many tools created before that have helped inspire its creation.
1414

1515
It provides a better alternative than reading the *CLI Parameters* as a `list` of `str` and parsing everything by hand.
1616

17-
!!! check "Inspired **Typer** to"
18-
Provide a better development experience than just reading *CLI Parameters* by hand.
17+
/// check | Inspired **Typer** to
18+
19+
Provide a better development experience than just reading *CLI Parameters* by hand.
20+
21+
///
1922

2023
### <a href="https://www.hug.rest/" class="external-link" target="_blank">Hug</a>
2124

2225
Hug is a library to create APIs and CLIs, it uses parameters in functions to declare the required data.
2326

2427
It inspired a lot of the ideas in **FastAPI** and **Typer**.
2528

26-
!!! check "Inspired **Typer** to"
27-
Use function parameters to declare *CLI arguments* and *CLI options* as it simplifies a lot the development experience.
29+
/// check | Inspired **Typer** to
30+
31+
Use function parameters to declare *CLI arguments* and *CLI options* as it simplifies a lot the development experience.
32+
33+
///
2834

2935
### <a href="https://plac.readthedocs.io/en/latest/" class="external-link" target="_blank">Plac</a>
3036

3137
Plac is another library to create CLIs using parameters in functions, similar to Hug.
3238

33-
!!! check "Inspired **Typer** to"
34-
Provide a simple way to use a function as a command line app, without having to create a complete app, with `typer.run(some_function)`.
39+
/// check | Inspired **Typer** to
40+
41+
Provide a simple way to use a function as a command line app, without having to create a complete app, with `typer.run(some_function)`.
42+
43+
///
3544

3645
### <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a>
3746

@@ -41,8 +50,11 @@ It powers **FastAPI** underneath.
4150

4251
It is not used by **Typer**, but it inspired a lot of the design (through **FastAPI**).
4352

44-
!!! check "Inspired **Typer** to"
45-
Use standard Python type annotations to declare types instead of library-specific types or classes and use them for data validation and documentation.
53+
/// check | Inspired **Typer** to
54+
55+
Use standard Python type annotations to declare types instead of library-specific types or classes and use them for data validation and documentation.
56+
57+
///
4658

4759
### <a href="https://click.palletsprojects.com" class="external-link" target="_blank">Click</a>
4860

@@ -56,12 +68,15 @@ It uses decorators on top of functions to modify the actual value of those funct
5668

5769
It was built with some great ideas and design using the features available in the language at the time (Python 2.x).
5870

59-
!!! check "**Typer** uses it for"
60-
Everything. 🚀
71+
/// check | **Typer** uses it for
72+
73+
Everything. 🚀
6174

62-
**Typer** mainly adds a layer on top of Click, making the code simpler and easier to use, with autocompletion everywhere, etc, but providing all the powerful features of Click underneath.
75+
**Typer** mainly adds a layer on top of Click, making the code simpler and easier to use, with autocompletion everywhere, etc, but providing all the powerful features of Click underneath.
6376

64-
As someone pointed out: <em><a href="https://twitter.com/fishnets88/status/1210126833745838080" class="external-link" target="_blank">"Nice to see it is built on Click but adds the type stuff. Me gusta!"</a></em>
77+
As someone pointed out: <em><a href="https://twitter.com/fishnets88/status/1210126833745838080" class="external-link" target="_blank">"Nice to see it is built on Click but adds the type stuff. Me gusta!"</a></em>
78+
79+
///
6580

6681
### <a href="https://github.com/click-contrib/click-completion" class="external-link" target="_blank">`click-completion`</a>
6782

@@ -71,8 +86,11 @@ Previous versions of **Typer** had deep integrations with `click-completion` and
7186

7287
And now **Typer** improved it to have new features, tests, some bug fixes (for issues in plain `click-completion` and Click), and better support for shells, including modern versions of PowerShell (e.g. the default versions that come with Windows 10).
7388

74-
!!! check "Inspired **Typer** to"
75-
Provide auto completion for all the shells.
89+
/// check | Inspired **Typer** to
90+
91+
Provide auto completion for all the shells.
92+
93+
///
7694

7795
### <a href="https://fastapi.tiangolo.com/" class="external-link" target="_blank">FastAPI</a>
7896

0 commit comments

Comments
 (0)