Skip to content

Commit 365e374

Browse files
authored
Merge branch 'master' into feat/autocompletion
2 parents da62b3b + b88c327 commit 365e374

File tree

9 files changed

+54
-11
lines changed

9 files changed

+54
-11
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- mkdocs.no-insiders.yml
4141
- .github/workflows/build-docs.yml
4242
- .github/workflows/deploy-docs.yml
43+
- data/**
4344
4445
build-docs:
4546
needs:

.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.8.0
17+
rev: v0.8.1
1818
hooks:
1919
- id: ruff
2020
args:

data/members.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
members:
22
- login: tiangolo
33
- login: svlandeg
4+
- login: patrick91

docs/release-notes.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
## Latest Changes
44

5+
### Features
6+
7+
* 🗑️ Deprecate `shell_complete` and continue to use `autocompletion` for CLI parameters. PR [#974](https://github.com/fastapi/typer/pull/974) by [@svlandeg](https://github.com/svlandeg).
8+
9+
### Docs
10+
11+
* ✏️ Fix a few small typos in the documentation. PR [#1077](https://github.com/fastapi/typer/pull/1077) by [@svlandeg](https://github.com/svlandeg).
12+
13+
### Internal
14+
15+
* 🔧 Update build-docs filter patterns. PR [#1080](https://github.com/fastapi/typer/pull/1080) by [@tiangolo](https://github.com/tiangolo).
16+
* 🔨 Update deploy docs preview script. PR [#1079](https://github.com/fastapi/typer/pull/1079) by [@tiangolo](https://github.com/tiangolo).
17+
* 🔧 Update members. PR [#1078](https://github.com/fastapi/typer/pull/1078) by [@tiangolo](https://github.com/tiangolo).
18+
*[pre-commit.ci] pre-commit autoupdate. PR [#1071](https://github.com/fastapi/typer/pull/1071) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci).
19+
* ⬆ Update httpx requirement from <0.28.0,>=0.27.0 to >=0.27.0,<0.29.0. PR [#1065](https://github.com/fastapi/typer/pull/1065) by [@dependabot[bot]](https://github.com/apps/dependabot).
20+
521
## 0.15.0
622

723
### Features

requirements-github-actions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PyGithub>=2.3.0,<3.0.0
22
pydantic>=2.5.3,<3.0.0
33
pydantic-settings>=2.1.0,<3.0.0
4-
httpx>=0.27.0,<0.28.0
4+
httpx>=0.27.0,<0.29.0
55
smokeshow

scripts/deploy_docs_status.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
import re
33

44
from github import Github
5-
from pydantic import SecretStr
5+
from pydantic import BaseModel, SecretStr
66
from pydantic_settings import BaseSettings
77

8+
site_domain = "typer.tiangolo.com"
9+
810

911
class Settings(BaseSettings):
1012
github_repository: str
@@ -15,7 +17,12 @@ class Settings(BaseSettings):
1517
is_done: bool = False
1618

1719

18-
def main():
20+
class LinkData(BaseModel):
21+
previous_link: str
22+
preview_link: str
23+
24+
25+
def main() -> None:
1926
logging.basicConfig(level=logging.INFO)
2027
settings = Settings()
2128

@@ -60,24 +67,31 @@ def main():
6067
docs_files = [f for f in files if f.filename.startswith("docs/")]
6168

6269
deploy_url = settings.deploy_url.rstrip("/")
63-
links: list[str] = []
70+
links: list[LinkData] = []
6471
for f in docs_files:
6572
match = re.match(r"docs/(.*)", f.filename)
66-
assert match
73+
if not match:
74+
continue
6775
path = match.group(1)
6876
if path.endswith("index.md"):
69-
path = path.replace("index.md", "")
77+
use_path = path.replace("index.md", "")
7078
else:
71-
path = path.replace(".md", "/")
72-
link = f"{deploy_url}/{path}"
79+
use_path = path.replace(".md", "/")
80+
link = LinkData(
81+
previous_link=f"https://{site_domain}/{use_path}",
82+
preview_link=f"{deploy_url}/{use_path}",
83+
)
7384
links.append(link)
74-
links.sort()
85+
links.sort(key=lambda x: x.preview_link)
7586

7687
message = f"📝 Docs preview for commit {settings.commit_sha} at: {deploy_url}"
7788

7889
if links:
7990
message += "\n\n### Modified Pages\n\n"
80-
message += "\n".join([f"* {link}" for link in links])
91+
for link in links:
92+
message += f"* {link.preview_link}"
93+
message += f" - ([before]({link.previous_link}))"
94+
message += "\n"
8195

8296
print(message)
8397
use_pr.as_issue().create_comment(message)

typer/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ def __init__(
274274
is_eager: bool = False,
275275
envvar: Optional[Union[str, List[str]]] = None,
276276
# Note that shell_complete is not fully supported and will be removed in future versions
277+
# TODO: Remove shell_complete in a future version (after 0.16.0)
277278
shell_complete: Optional[
278279
Callable[
279280
[click.Context, click.Parameter, str],
@@ -414,6 +415,7 @@ def __init__(
414415
is_eager: bool = False,
415416
envvar: Optional[Union[str, List[str]]] = None,
416417
# Note that shell_complete is not fully supported and will be removed in future versions
418+
# TODO: Remove shell_complete in a future version (after 0.16.0)
417419
shell_complete: Optional[
418420
Callable[
419421
[click.Context, click.Parameter, str],

typer/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def __init__(
174174
is_eager: bool = False,
175175
envvar: Optional[Union[str, List[str]]] = None,
176176
# Note that shell_complete is not fully supported and will be removed in future versions
177+
# TODO: Remove shell_complete in a future version (after 0.16.0)
177178
shell_complete: Optional[
178179
Callable[
179180
[click.Context, click.Parameter, str],
@@ -283,6 +284,7 @@ def __init__(
283284
is_eager: bool = False,
284285
envvar: Optional[Union[str, List[str]]] = None,
285286
# Note that shell_complete is not fully supported and will be removed in future versions
287+
# TODO: Remove shell_complete in a future version (after 0.16.0)
286288
shell_complete: Optional[
287289
Callable[
288290
[click.Context, click.Parameter, str],
@@ -411,6 +413,7 @@ def __init__(
411413
is_eager: bool = False,
412414
envvar: Optional[Union[str, List[str]]] = None,
413415
# Note that shell_complete is not fully supported and will be removed in future versions
416+
# TODO: Remove shell_complete in a future version (after 0.16.0)
414417
shell_complete: Optional[
415418
Callable[
416419
[click.Context, click.Parameter, str],

typer/params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def Option(
2020
is_eager: bool = False,
2121
envvar: Optional[Union[str, List[str]]] = None,
2222
# Note that shell_complete is not fully supported and will be removed in future versions
23+
# TODO: Remove shell_complete in a future version (after 0.16.0)
2324
shell_complete: Optional[
2425
Callable[
2526
[click.Context, click.Parameter, str],
@@ -85,6 +86,7 @@ def Option(
8586
is_eager: bool = False,
8687
envvar: Optional[Union[str, List[str]]] = None,
8788
# Note that shell_complete is not fully supported and will be removed in future versions
89+
# TODO: Remove shell_complete in a future version (after 0.16.0)
8890
shell_complete: Optional[
8991
Callable[
9092
[click.Context, click.Parameter, str],
@@ -148,6 +150,7 @@ def Option(
148150
is_eager: bool = False,
149151
envvar: Optional[Union[str, List[str]]] = None,
150152
# Note that shell_complete is not fully supported and will be removed in future versions
153+
# TODO: Remove shell_complete in a future version (after 0.16.0)
151154
shell_complete: Optional[
152155
Callable[
153156
[click.Context, click.Parameter, str],
@@ -269,6 +272,7 @@ def Argument(
269272
is_eager: bool = False,
270273
envvar: Optional[Union[str, List[str]]] = None,
271274
# Note that shell_complete is not fully supported and will be removed in future versions
275+
# TODO: Remove shell_complete in a future version (after 0.16.0)
272276
shell_complete: Optional[
273277
Callable[
274278
[click.Context, click.Parameter, str],
@@ -325,6 +329,7 @@ def Argument(
325329
is_eager: bool = False,
326330
envvar: Optional[Union[str, List[str]]] = None,
327331
# Note that shell_complete is not fully supported and will be removed in future versions
332+
# TODO: Remove shell_complete in a future version (after 0.16.0)
328333
shell_complete: Optional[
329334
Callable[
330335
[click.Context, click.Parameter, str],
@@ -379,6 +384,7 @@ def Argument(
379384
is_eager: bool = False,
380385
envvar: Optional[Union[str, List[str]]] = None,
381386
# Note that shell_complete is not fully supported and will be removed in future versions
387+
# TODO: Remove shell_complete in a future version (after 0.16.0)
382388
shell_complete: Optional[
383389
Callable[
384390
[click.Context, click.Parameter, str],

0 commit comments

Comments
 (0)