Skip to content

Commit 8668bb7

Browse files
authored
Merge branch 'master' into feat/autocompletion
2 parents 00e6af5 + 8f4f267 commit 8668bb7

Some content is hidden

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

63 files changed

+369
-1876
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.7.2
17+
rev: v0.7.4
1818
hooks:
1919
- id: ruff
2020
args:

docs/release-notes.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44

55
### Internal
66

7+
*[pre-commit.ci] pre-commit autoupdate. PR [#1053](https://github.com/fastapi/typer/pull/1053) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
8+
9+
## 0.13.1
10+
11+
### Features
12+
13+
* ✨ Remove Rich tags when showing completion text. PR [#877](https://github.com/fastapi/typer/pull/877) by [@svlandeg](https://github.com/svlandeg).
14+
* ✨ Render Rich markup as HTML in Markdown docs. PR [#847](https://github.com/fastapi/typer/pull/847) by [@svlandeg](https://github.com/svlandeg).
15+
* ✨ Support cp850 encoding for auto-completion in PowerShell. PR [#808](https://github.com/fastapi/typer/pull/808) by [@svlandeg](https://github.com/svlandeg).
16+
* ✨ Allow gettext translation of help message. PR [#886](https://github.com/fastapi/typer/pull/886) by [@svlandeg](https://github.com/svlandeg).
17+
18+
### Refactors
19+
20+
* 🐛 Fix printing HTML from Rich output. PR [#1055](https://github.com/fastapi/typer/pull/1055) by [@tiangolo](https://github.com/tiangolo).
21+
22+
### Docs
23+
24+
* 📝 Update markdown includes to use the new simpler format. PR [#1054](https://github.com/fastapi/typer/pull/1054) by [@tiangolo](https://github.com/tiangolo).
25+
26+
### Internal
27+
28+
* ⬆ Bump ruff from 0.7.3 to 0.7.4. PR [#1051](https://github.com/fastapi/typer/pull/1051) by [@dependabot[bot]](https://github.com/apps/dependabot).
29+
*[pre-commit.ci] pre-commit autoupdate. PR [#1047](https://github.com/fastapi/typer/pull/1047) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
30+
* ⬆ Bump ruff from 0.7.2 to 0.7.3. PR [#1046](https://github.com/fastapi/typer/pull/1046) by [@dependabot[bot]](https://github.com/apps/dependabot).
731
* ⬆ Bump tiangolo/latest-changes from 0.3.1 to 0.3.2. PR [#1044](https://github.com/fastapi/typer/pull/1044) by [@dependabot[bot]](https://github.com/apps/dependabot).
832
* ⬆ Update pytest-cov requirement from <6.0.0,>=2.10.0 to >=2.10.0,<7.0.0. PR [#1033](https://github.com/fastapi/typer/pull/1033) by [@dependabot[bot]](https://github.com/apps/dependabot).
933

docs/tutorial/app-dir.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
You can get the application directory where you can, for example, save configuration files with `typer.get_app_dir()`:
44

5-
```Python hl_lines="9"
6-
{!../docs_src/app_dir/tutorial001.py!}
7-
```
5+
{* docs_src/app_dir/tutorial001.py hl[9] *}
86

97
It will give you a directory for storing configurations appropriate for your CLI program for the current user in each operating system.
108

docs/tutorial/arguments/default.md

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,7 @@ That way the *CLI argument* will be optional *and also* have a default value.
88

99
We can also use `typer.Argument()` to make a *CLI argument* have a default value other than `None`:
1010

11-
//// tab | Python 3.7+
12-
13-
```Python hl_lines="5"
14-
{!> ../docs_src/arguments/default/tutorial001_an.py!}
15-
```
16-
17-
////
18-
19-
//// tab | Python 3.7+ non-Annotated
20-
21-
/// tip
22-
23-
Prefer to use the `Annotated` version if possible.
24-
25-
///
26-
27-
```Python hl_lines="4"
28-
{!> ../docs_src/arguments/default/tutorial001.py!}
29-
```
30-
31-
////
11+
{* docs_src/arguments/default/tutorial001_an.py hl[5] *}
3212

3313
/// tip
3414

@@ -72,27 +52,7 @@ Hello Camila
7252

7353
And we can even make the default value be dynamically generated by passing a function as the `default_factory` argument:
7454

75-
//// tab | Python 3.7+
76-
77-
```Python hl_lines="7-8 11"
78-
{!> ../docs_src/arguments/default/tutorial002_an.py!}
79-
```
80-
81-
////
82-
83-
//// tab | Python 3.7+ non-Annotated
84-
85-
/// tip
86-
87-
Prefer to use the `Annotated` version if possible.
88-
89-
///
90-
91-
```Python hl_lines="6-7 10"
92-
{!> ../docs_src/arguments/default/tutorial002.py!}
93-
```
94-
95-
////
55+
{* docs_src/arguments/default/tutorial002_an.py hl[7:8,11] *}
9656

9757
In this case, we created the function `get_name` that will just return a random `str` each time.
9858

docs/tutorial/arguments/envvar.md

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,7 @@ You can learn more about environment variables in the [Environment Variables](..
1010

1111
To do that, use the `envvar` parameter for `typer.Argument()`:
1212

13-
//// tab | Python 3.7+
14-
15-
```Python hl_lines="5"
16-
{!> ../docs_src/arguments/envvar/tutorial001_an.py!}
17-
```
18-
19-
////
20-
21-
//// tab | Python 3.7+ non-Annotated
22-
23-
/// tip
24-
25-
Prefer to use the `Annotated` version if possible.
26-
27-
///
28-
29-
```Python hl_lines="4"
30-
{!> ../docs_src/arguments/envvar/tutorial001.py!}
31-
```
32-
33-
////
13+
{* docs_src/arguments/envvar/tutorial001_an.py hl[5] *}
3414

3515
In this case, the *CLI argument* `name` will have a default value of `"World"`, but will also read any value passed to the environment variable `AWESOME_NAME` if no value is provided in the command line:
3616

@@ -75,27 +55,7 @@ Hello Mr. Czernobog
7555

7656
You are not restricted to a single environment variable, you can declare a list of environment variables that could be used to get a value if it was not passed in the command line:
7757

78-
//// tab | Python 3.7+
79-
80-
```Python hl_lines="6"
81-
{!> ../docs_src/arguments/envvar/tutorial002_an.py!}
82-
```
83-
84-
////
85-
86-
//// tab | Python 3.7+ non-Annotated
87-
88-
/// tip
89-
90-
Prefer to use the `Annotated` version if possible.
91-
92-
///
93-
94-
```Python hl_lines="4"
95-
{!> ../docs_src/arguments/envvar/tutorial002.py!}
96-
```
97-
98-
////
58+
{* docs_src/arguments/envvar/tutorial002_an.py hl[6] *}
9959

10060
Check it:
10161

@@ -130,27 +90,7 @@ Hello Mr. Anubis
13090

13191
By default, environment variables used will be shown in the help text, but you can disable them with `show_envvar=False`:
13292

133-
//// tab | Python 3.7+
134-
135-
```Python hl_lines="7"
136-
{!> ../docs_src/arguments/envvar/tutorial003_an.py!}
137-
```
138-
139-
////
140-
141-
//// tab | Python 3.7+ non-Annotated
142-
143-
/// tip
144-
145-
Prefer to use the `Annotated` version if possible.
146-
147-
///
148-
149-
```Python hl_lines="4"
150-
{!> ../docs_src/arguments/envvar/tutorial003.py!}
151-
```
152-
153-
////
93+
{* docs_src/arguments/envvar/tutorial003_an.py hl[7] *}
15494

15595
Check it:
15696

0 commit comments

Comments
 (0)