Skip to content

Commit 27cf371

Browse files
authored
Merge branch 'master' into fix_523
2 parents 8160ea7 + d6921fb commit 27cf371

Some content is hidden

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

64 files changed

+729
-296
lines changed

.github/workflows/test.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ jobs:
1212
runs-on: ubuntu-20.04
1313
strategy:
1414
matrix:
15-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
16-
click-7: [true, false]
15+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
16+
click-version:
17+
- click-7
18+
- click-8
1719
fail-fast: false
1820

1921
steps:
@@ -25,29 +27,25 @@ jobs:
2527
- name: Install Flit
2628
run: pip install flit
2729
- name: Install Dependencies
28-
if: ${{ matrix.python-version != '3.6' }}
2930
run: python -m flit install --symlink
30-
- name: Install Dependencies
31-
if: ${{ matrix.python-version == '3.6' }}
32-
# This doesn't install the editable install, so coverage doesn't get subprocesses
33-
run: python -m pip install ".[test]"
3431
- name: Install Click 7
35-
if: matrix.click-7
32+
if: matrix.click-version == 'click-7'
3633
run: pip install "click<8.0.0"
3734
- name: Lint
38-
if: ${{ matrix.python-version != '3.6' && matrix.click-7 == false }}
35+
if: ${{ matrix.click-version == 'click-8' }}
3936
run: bash scripts/lint.sh
4037
- run: mkdir coverage
4138
- name: Test
4239
run: bash scripts/test.sh
4340
env:
44-
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-click-7-${{ matrix.click-7 }}
45-
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-click-7-${{ matrix.click-7 }}
41+
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.click-version }}
42+
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.click-version }}
4643
- name: Store coverage files
4744
uses: actions/upload-artifact@v3
4845
with:
4946
name: coverage
5047
path: coverage
48+
5149
coverage-combine:
5250
needs: [test]
5351
runs-on: ubuntu-latest
@@ -77,3 +75,19 @@ jobs:
7775
with:
7876
name: coverage-html
7977
path: htmlcov
78+
79+
# https://github.com/marketplace/actions/alls-green#why
80+
check: # This job does nothing and is only used for the branch protection
81+
if: always()
82+
needs:
83+
- coverage-combine
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Dump GitHub context
87+
env:
88+
GITHUB_CONTEXT: ${{ toJson(github) }}
89+
run: echo "$GITHUB_CONTEXT"
90+
- name: Decide whether the needed jobs succeeded or failed
91+
uses: re-actors/alls-green@release/v1
92+
with:
93+
jobs: ${{ toJSON(needs) }}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.vscode
22
*.pyc
33
__pycache__
4-
env3.7
5-
env3.6
4+
.venv*
65
env
76
dist
87
.mypy_cache

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
---
2828

29-
Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python 3.6+ type hints.
29+
Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.
3030

3131
The key features are:
3232

@@ -46,8 +46,6 @@ And it's intended to be the FastAPI of CLIs.
4646

4747
## Requirements
4848

49-
Python 3.6+
50-
5149
**Typer** stands on the shoulders of a giant. Its only internal dependency is <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>.
5250

5351
## Installation
@@ -277,7 +275,7 @@ You do that with standard modern Python types.
277275

278276
You don't have to learn a new syntax, the methods or classes of a specific library, etc.
279277

280-
Just standard **Python 3.6+**.
278+
Just standard **Python**.
281279

282280
For example, for an `int`:
283281

docs/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It follows the same design and ideas. If you know **FastAPI**, you already know
88

99
## Just Modern Python
1010

11-
It's all based on standard **Python 3.6 type** declarations. No new syntax to learn. Just standard modern Python.
11+
It's all based on standard **Python type** declarations. No new syntax to learn. Just standard modern Python.
1212

1313
If you need a 2 minute refresher of how to use Python types (even if you don't use FastAPI or Typer), check the FastAPI tutorial section: <a href="https://fastapi.tiangolo.com/python-types/" class="external-link" target="_blank">Python types intro</a>.
1414

docs/index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
---
2828

29-
Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python 3.6+ type hints.
29+
Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.
3030

3131
The key features are:
3232

@@ -46,8 +46,6 @@ And it's intended to be the FastAPI of CLIs.
4646

4747
## Requirements
4848

49-
Python 3.6+
50-
5149
**Typer** stands on the shoulders of a giant. Its only internal dependency is <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>.
5250

5351
## Installation
@@ -277,7 +275,7 @@ You do that with standard modern Python types.
277275

278276
You don't have to learn a new syntax, the methods or classes of a specific library, etc.
279277

280-
Just standard **Python 3.6+**.
278+
Just standard **Python**.
281279

282280
For example, for an `int`:
283281

docs/release-notes.md

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,73 @@
11
## Latest Changes
22

3-
*[pre-commit.ci] pre-commit autoupdate. PR [#606](https://github.com/tiangolo/typer/pull/606) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
4-
* 👷 Install MkDocs Material Insiders only when secrets are available, for Dependabot. PR [#685](https://github.com/tiangolo/typer/pull/685) by [@tiangolo](https://github.com/tiangolo).
5-
* ⚒️ Update build-docs.yml, do not zip docs. PR [#645](https://github.com/tiangolo/typer/pull/645) by [@tiangolo](https://github.com/tiangolo).
6-
* 👷 Deploy docs to Cloudflare. PR [#644](https://github.com/tiangolo/typer/pull/644) by [@tiangolo](https://github.com/tiangolo).
7-
* 👷 Upgrade CI for docs. PR [#642](https://github.com/tiangolo/typer/pull/642) by [@tiangolo](https://github.com/tiangolo).
8-
* 👷 Update token for latest changes. PR [#635](https://github.com/tiangolo/typer/pull/635) by [@tiangolo](https://github.com/tiangolo).
9-
* 👷 Update CI workflow dispatch for latest changes. PR [#643](https://github.com/tiangolo/typer/pull/643) by [@tiangolo](https://github.com/tiangolo).
10-
* 👷 Update token for Material for MkDocs Insiders. PR [#636](https://github.com/tiangolo/typer/pull/636) by [@tiangolo](https://github.com/tiangolo).
11-
* 🐛 Fix internal type annotations and bump mypy version. PR [#638](https://github.com/tiangolo/typer/pull/638) by [@paulo-raca](https://github.com/paulo-raca).
12-
* 📝 Remove obsolete references to `--install-completion` for `typer.run()` scripts. PR [#595](https://github.com/tiangolo/typer/pull/595) by [@tiangolo](https://github.com/tiangolo).
3+
### Breaking Changes
4+
5+
* 🔥 Remove support for Python 3.6. PR [#758](https://github.com/tiangolo/typer/pull/758) by [@tiangolo](https://github.com/tiangolo).
6+
7+
### Internal
8+
9+
* 👷 Add alls-green to CI. PR [#759](https://github.com/tiangolo/typer/pull/759) by [@tiangolo](https://github.com/tiangolo).
10+
11+
## 0.10.0
12+
13+
### Fixes
14+
15+
* 🐛 Fix default value of `None` for CLI Parameters when the type is `list | None` and the default value is `None`. PR [#664](https://github.com/tiangolo/typer/pull/664) by [@theowisear](https://github.com/theowisear).
16+
17+
## 0.9.4
18+
19+
### Features
20+
21+
* ✨ Improve support for CLI translations using gettext. PR [#417](https://github.com/tiangolo/typer/pull/417) by [@mjodmj](https://github.com/mjodmj).
22+
23+
## 0.9.3
24+
25+
### Fixes
26+
27+
* 🐛 Fix evaluating stringified annotations in Python 3.10 (also `from __future__ import annotations`). PR [#721](https://github.com/tiangolo/typer/pull/721) by [@heckad](https://github.com/heckad).
28+
29+
## 0.9.2
30+
31+
### Fixes
32+
33+
* 🐛 Fix display of default value for Enum parameters inside of a list, include docs and tests. PR [#473](https://github.com/tiangolo/typer/pull/473) by [@asieira](https://github.com/asieira).
34+
* 🐛 Update type annotations for `show_default` parameter and update docs for setting a "Custom default string". PR [#501](https://github.com/tiangolo/typer/pull/501) by [@plannigan](https://github.com/plannigan).
35+
36+
### Docs
37+
38+
* 📝 Add docs and test for `no_args_is_help` feature. PR [#751](https://github.com/tiangolo/typer/pull/751) by [@svlandeg](https://github.com/svlandeg).
39+
40+
## 0.9.1
41+
42+
### Fixes
43+
44+
* 🐛 Add missing `default_factory` in `Argument` overloads. PR [#750](https://github.com/tiangolo/typer/pull/750) by [@m9810223](https://github.com/m9810223).
45+
* 🐛 Fix preserving case in enum values. PR [#571](https://github.com/tiangolo/typer/pull/571) by [@avaldebe](https://github.com/avaldebe).
1346

1447
### Docs
1548

49+
* 📝 Remove obsolete references to `--install-completion` for `typer.run()` scripts. PR [#595](https://github.com/tiangolo/typer/pull/595) by [@tiangolo](https://github.com/tiangolo).
50+
51+
* 📝 Update docs example for a Typer/Click group to make new subcommands explicit. PR [#755](https://github.com/tiangolo/typer/pull/755) by [@svlandeg](https://github.com/svlandeg).
52+
* 📝 Update docs for building a package, file structure example. PR [#683](https://github.com/tiangolo/typer/pull/683) by [@davidbgk](https://github.com/davidbgk).
53+
* 📝 Update link in docs to the newest stable version of click. PR [#675](https://github.com/tiangolo/typer/pull/675) by [@javier171188](https://github.com/javier171188).
1654
* 🔧 Add `CITATION.cff` file for academic citations. PR [#681](https://github.com/tiangolo/typer/pull/681) by [@tiangolo](https://github.com/tiangolo).
1755
* ✏ Fix typo in `docs/tutorial/exceptions.md`. PR [#702](https://github.com/tiangolo/typer/pull/702) by [@menzenski](https://github.com/menzenski).
1856
* ✏ Fix typo in `docs/tutorial/options/name.md`. PR [#725](https://github.com/tiangolo/typer/pull/725) by [@bwagner](https://github.com/bwagner).
1957
* ✏ Fix typo in `docs/tutorial/arguments/optional.md`. PR [#602](https://github.com/tiangolo/typer/pull/602) by [@tadasgedgaudas](https://github.com/tadasgedgaudas).
2058

2159
### Internal
2260

61+
*[pre-commit.ci] pre-commit autoupdate. PR [#606](https://github.com/tiangolo/typer/pull/606) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
62+
* 👷 Install MkDocs Material Insiders only when secrets are available, for Dependabot. PR [#685](https://github.com/tiangolo/typer/pull/685) by [@tiangolo](https://github.com/tiangolo).
63+
* ⚒️ Update build-docs.yml, do not zip docs. PR [#645](https://github.com/tiangolo/typer/pull/645) by [@tiangolo](https://github.com/tiangolo).
64+
* 👷 Deploy docs to Cloudflare. PR [#644](https://github.com/tiangolo/typer/pull/644) by [@tiangolo](https://github.com/tiangolo).
65+
* 👷 Upgrade CI for docs. PR [#642](https://github.com/tiangolo/typer/pull/642) by [@tiangolo](https://github.com/tiangolo).
66+
* 👷 Update token for latest changes. PR [#635](https://github.com/tiangolo/typer/pull/635) by [@tiangolo](https://github.com/tiangolo).
67+
* 👷 Update CI workflow dispatch for latest changes. PR [#643](https://github.com/tiangolo/typer/pull/643) by [@tiangolo](https://github.com/tiangolo).
68+
* 👷 Update token for Material for MkDocs Insiders. PR [#636](https://github.com/tiangolo/typer/pull/636) by [@tiangolo](https://github.com/tiangolo).
69+
* 🐛 Fix internal type annotations and bump mypy version. PR [#638](https://github.com/tiangolo/typer/pull/638) by [@paulo-raca](https://github.com/paulo-raca).
70+
* 💡 Add comments to document overload definitions in code. PR [#752](https://github.com/tiangolo/typer/pull/752) by [@svlandeg](https://github.com/svlandeg).
2371
* 🔥 Remove Jina QA Bot as it has been discontinued. PR [#749](https://github.com/tiangolo/typer/pull/749) by [@tiangolo](https://github.com/tiangolo).
2472
* 👷 Update build docs CI cache paths. PR [#707](https://github.com/tiangolo/typer/pull/707) by [@tiangolo](https://github.com/tiangolo).
2573
* 👷 Upgrade latest-changes GitHub Action. PR [#691](https://github.com/tiangolo/typer/pull/691) by [@tiangolo](https://github.com/tiangolo).

docs/tutorial/arguments/default.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ That way the *CLI argument* will be optional *and also* have a default value.
66

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

9-
=== "Python 3.6+"
9+
=== "Python 3.7+"
1010

1111
```Python hl_lines="5"
1212
{!> ../docs_src/arguments/default/tutorial001_an.py!}
1313
```
1414

15-
=== "Python 3.6+ non-Annotated"
15+
=== "Python 3.7+ non-Annotated"
1616

1717
!!! tip
1818
Prefer to use the `Annotated` version if possible.
@@ -60,13 +60,13 @@ Hello Camila
6060

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

63-
=== "Python 3.6+"
63+
=== "Python 3.7+"
6464

6565
```Python hl_lines="7-8 11"
6666
{!> ../docs_src/arguments/default/tutorial002_an.py!}
6767
```
6868

69-
=== "Python 3.6+ non-Annotated"
69+
=== "Python 3.7+ non-Annotated"
7070

7171
!!! tip
7272
Prefer to use the `Annotated` version if possible.

docs/tutorial/arguments/envvar.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ You can also configure a *CLI argument* to read a value from an environment vari
22

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

5-
=== "Python 3.6+"
5+
=== "Python 3.7+"
66

77
```Python hl_lines="5"
88
{!> ../docs_src/arguments/envvar/tutorial001_an.py!}
99
```
1010

11-
=== "Python 3.6+ non-Annotated"
11+
=== "Python 3.7+ non-Annotated"
1212

1313
!!! tip
1414
Prefer to use the `Annotated` version if possible.
@@ -60,13 +60,13 @@ Hello Mr. Czernobog
6060

6161
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:
6262

63-
=== "Python 3.6+"
63+
=== "Python 3.7+"
6464

6565
```Python hl_lines="6"
6666
{!> ../docs_src/arguments/envvar/tutorial002_an.py!}
6767
```
6868

69-
=== "Python 3.6+ non-Annotated"
69+
=== "Python 3.7+ non-Annotated"
7070

7171
!!! tip
7272
Prefer to use the `Annotated` version if possible.
@@ -108,13 +108,13 @@ Hello Mr. Anubis
108108

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

111-
=== "Python 3.6+"
111+
=== "Python 3.7+"
112112

113113
```Python hl_lines="7"
114114
{!> ../docs_src/arguments/envvar/tutorial003_an.py!}
115115
```
116116

117-
=== "Python 3.6+ non-Annotated"
117+
=== "Python 3.7+ non-Annotated"
118118

119119
!!! tip
120120
Prefer to use the `Annotated` version if possible.

0 commit comments

Comments
 (0)