Skip to content

Commit ac5d5d6

Browse files
committed
Merge branch 'master' into lachaib/issue181
2 parents 459fa0b + 9342f8c commit ac5d5d6

File tree

10 files changed

+78
-92
lines changed

10 files changed

+78
-92
lines changed

.github/workflows/build-docs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ jobs:
6464
with:
6565
key: mkdocs-cards-${{ github.ref }}-v1
6666
path: .cache
67-
- name: Verify README
68-
run: uv run ./scripts/docs.py verify-readme
6967
- name: Build Docs
7068
run: uv run ./scripts/docs.py build
7169
- uses: actions/upload-artifact@v6

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ jobs:
5555
uv.lock
5656
- name: Install Dependencies
5757
run: uv sync --locked --no-dev --group tests
58-
- name: Lint
59-
if: matrix.python-version != '3.9'
60-
run: uv run bash scripts/lint.sh
6158
- run: mkdir coverage
6259
- run: uv run bash scripts/test-files.sh
6360
- name: Test

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,17 @@ repos:
2727
require_serial: true
2828
language: unsupported
2929
types: [python]
30+
31+
- id: local-mypy
32+
name: mypy check
33+
entry: uv run mypy typer
34+
require_serial: true
35+
language: unsupported
36+
pass_filenames: false
37+
38+
- id: generate-readme
39+
language: unsupported
40+
name: generate README.md from index.md
41+
entry: uv run ./scripts/docs.py generate-readme
42+
files: ^docs/index\.md|scripts/docs\.py$
43+
pass_filenames: false

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ The key features are:
4040
* **Grow large**: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.
4141
* **Run scripts**: Typer includes a `typer` command/program that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.
4242

43+
## 2026 February - Typer developer survey
44+
45+
Help us define Typer's future by filling the <a href="https://forms.gle/nYvutPrVkmBQZLas7" class="external-link" target="_blank">Typer developer survey</a>. ✨
46+
4347
## FastAPI of CLIs
4448

4549
**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ The key features are:
4646
* **Grow large**: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.
4747
* **Run scripts**: Typer includes a `typer` command/program that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.
4848

49+
## 2026 February - Typer developer survey
50+
51+
Help us define Typer's future by filling the <a href="https://forms.gle/nYvutPrVkmBQZLas7" class="external-link" target="_blank">Typer developer survey</a>. ✨
52+
4953
## FastAPI of CLIs
5054

5155
**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.

docs/release-notes.md

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

55
### Docs
66

7+
* 📝 Add link to Typer developer survey. PR [#1514](https://github.com/fastapi/typer/pull/1514) by [@tiangolo](https://github.com/tiangolo).
78
* 📝 Add contribution instructions about LLM generated code and comments and automated tools for PRs. PR [#1489](https://github.com/fastapi/typer/pull/1489) by [@alejsdev](https://github.com/alejsdev).
89
* 🐛 Fix copy button in `custom.js`. PR [#1488](https://github.com/fastapi/typer/pull/1488) by [@alejsdev](https://github.com/alejsdev).
910

1011
### Internal
1112

13+
* 🔧 Add generate-readme to pre-commit. PR [#1515](https://github.com/fastapi/typer/pull/1515) by [@tiangolo](https://github.com/tiangolo).
14+
* 👷 Run mypy in pre-commit instead of `Lint` step in `test.yml` workflow. PR [#1511](https://github.com/fastapi/typer/pull/1511) by [@YuriiMotov](https://github.com/YuriiMotov).
15+
* ⬆ Bump prek from 0.3.0 to 0.3.1. PR [#1510](https://github.com/fastapi/typer/pull/1510) by [@dependabot[bot]](https://github.com/apps/dependabot).
16+
* ⬆ Bump rich from 14.3.1 to 14.3.2. PR [#1509](https://github.com/fastapi/typer/pull/1509) by [@dependabot[bot]](https://github.com/apps/dependabot).
17+
* ✅ Update test to use `mod` fixture. PR [#1506](https://github.com/fastapi/typer/pull/1506) by [@svlandeg](https://github.com/svlandeg).
1218
* ⬆ Bump rich from 14.2.0 to 14.3.1. PR [#1502](https://github.com/fastapi/typer/pull/1502) by [@dependabot[bot]](https://github.com/apps/dependabot).
1319
* ⬆ Bump ruff from 0.14.13 to 0.14.14. PR [#1499](https://github.com/fastapi/typer/pull/1499) by [@dependabot[bot]](https://github.com/apps/dependabot).
1420
* 🔧 Ensure that an edit to `uv.lock` gets the `internal` label. PR [#1497](https://github.com/fastapi/typer/pull/1497) by [@svlandeg](https://github.com/svlandeg).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ standard = [
5757
dev = [
5858
{ include-group = "tests" },
5959
{ include-group = "docs" },
60-
"prek==0.3.0",
60+
"prek==0.3.1",
6161
]
6262
docs = [
6363
"cairosvg==2.8.2",

tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,60 @@
1+
import importlib
12
import subprocess
23
import sys
4+
from types import ModuleType
35

6+
import pytest
47
from typer.testing import CliRunner
58

6-
from docs_src.multiple_values.arguments_with_multiple_values import (
7-
tutorial002_py39 as mod,
8-
)
9-
109
runner = CliRunner()
11-
app = mod.app
1210

1311

14-
def test_help():
15-
result = runner.invoke(app, ["--help"])
12+
@pytest.fixture(
13+
name="mod",
14+
params=[
15+
pytest.param("tutorial002_py39"),
16+
pytest.param("tutorial002_an_py39"),
17+
],
18+
)
19+
def get_mod(request: pytest.FixtureRequest) -> ModuleType:
20+
module_name = (
21+
f"docs_src.multiple_values.arguments_with_multiple_values.{request.param}"
22+
)
23+
mod = importlib.import_module(module_name)
24+
return mod
25+
26+
27+
def test_help(mod: ModuleType):
28+
result = runner.invoke(mod.app, ["--help"])
1629
assert result.exit_code == 0
1730
assert "[OPTIONS] [NAMES]..." in result.output
1831
assert "Arguments" in result.output
1932
assert "[default: Harry, Hermione, Ron]" in result.output
2033

2134

22-
def test_defaults():
23-
result = runner.invoke(app)
35+
def test_defaults(mod: ModuleType):
36+
result = runner.invoke(mod.app)
2437
assert result.exit_code == 0
2538
assert "Hello Harry" in result.output
2639
assert "Hello Hermione" in result.output
2740
assert "Hello Ron" in result.output
2841

2942

30-
def test_invalid_args():
31-
result = runner.invoke(app, ["Draco", "Hagrid"])
43+
def test_invalid_args(mod: ModuleType):
44+
result = runner.invoke(mod.app, ["Draco", "Hagrid"])
3245
assert result.exit_code != 0
3346
assert "Argument 'names' takes 3 values" in result.output
3447

3548

36-
def test_valid_args():
37-
result = runner.invoke(app, ["Draco", "Hagrid", "Dobby"])
49+
def test_valid_args(mod: ModuleType):
50+
result = runner.invoke(mod.app, ["Draco", "Hagrid", "Dobby"])
3851
assert result.exit_code == 0
3952
assert "Hello Draco" in result.stdout
4053
assert "Hello Hagrid" in result.stdout
4154
assert "Hello Dobby" in result.stdout
4255

4356

44-
def test_script():
57+
def test_script(mod: ModuleType):
4558
result = subprocess.run(
4659
[sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],
4760
capture_output=True,

tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py

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

0 commit comments

Comments
 (0)