diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index e8474352be..8f6ccf7c3a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -40,6 +40,7 @@ jobs: - mkdocs.no-insiders.yml - .github/workflows/build-docs.yml - .github/workflows/deploy-docs.yml + - data/** build-docs: needs: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 080c58e259..0f87638546 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.0 + rev: v0.8.1 hooks: - id: ruff args: diff --git a/data/members.yml b/data/members.yml index 2c30d19420..d5e314dccb 100644 --- a/data/members.yml +++ b/data/members.yml @@ -1,3 +1,4 @@ members: - login: tiangolo - login: svlandeg +- login: patrick91 diff --git a/docs/release-notes.md b/docs/release-notes.md index 75f14bea85..2d4befcfca 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,6 +2,22 @@ ## Latest Changes +### Features + +* 🗑️ 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). + +### Docs + +* ✏️ Fix a few small typos in the documentation. PR [#1077](https://github.com/fastapi/typer/pull/1077) by [@svlandeg](https://github.com/svlandeg). + +### Internal + +* 🔧 Update build-docs filter patterns. PR [#1080](https://github.com/fastapi/typer/pull/1080) by [@tiangolo](https://github.com/tiangolo). +* 🔨 Update deploy docs preview script. PR [#1079](https://github.com/fastapi/typer/pull/1079) by [@tiangolo](https://github.com/tiangolo). +* 🔧 Update members. PR [#1078](https://github.com/fastapi/typer/pull/1078) by [@tiangolo](https://github.com/tiangolo). +* ⬆ [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). +* ⬆ 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). + ## 0.15.0 ### Features diff --git a/requirements-github-actions.txt b/requirements-github-actions.txt index a6dace544f..5c3e02d8ae 100644 --- a/requirements-github-actions.txt +++ b/requirements-github-actions.txt @@ -1,5 +1,5 @@ PyGithub>=2.3.0,<3.0.0 pydantic>=2.5.3,<3.0.0 pydantic-settings>=2.1.0,<3.0.0 -httpx>=0.27.0,<0.28.0 +httpx>=0.27.0,<0.29.0 smokeshow diff --git a/scripts/deploy_docs_status.py b/scripts/deploy_docs_status.py index 8cef2f7581..1b9b5305a9 100644 --- a/scripts/deploy_docs_status.py +++ b/scripts/deploy_docs_status.py @@ -2,9 +2,11 @@ import re from github import Github -from pydantic import SecretStr +from pydantic import BaseModel, SecretStr from pydantic_settings import BaseSettings +site_domain = "typer.tiangolo.com" + class Settings(BaseSettings): github_repository: str @@ -15,7 +17,12 @@ class Settings(BaseSettings): is_done: bool = False -def main(): +class LinkData(BaseModel): + previous_link: str + preview_link: str + + +def main() -> None: logging.basicConfig(level=logging.INFO) settings = Settings() @@ -60,24 +67,31 @@ def main(): docs_files = [f for f in files if f.filename.startswith("docs/")] deploy_url = settings.deploy_url.rstrip("/") - links: list[str] = [] + links: list[LinkData] = [] for f in docs_files: match = re.match(r"docs/(.*)", f.filename) - assert match + if not match: + continue path = match.group(1) if path.endswith("index.md"): - path = path.replace("index.md", "") + use_path = path.replace("index.md", "") else: - path = path.replace(".md", "/") - link = f"{deploy_url}/{path}" + use_path = path.replace(".md", "/") + link = LinkData( + previous_link=f"https://{site_domain}/{use_path}", + preview_link=f"{deploy_url}/{use_path}", + ) links.append(link) - links.sort() + links.sort(key=lambda x: x.preview_link) message = f"📝 Docs preview for commit {settings.commit_sha} at: {deploy_url}" if links: message += "\n\n### Modified Pages\n\n" - message += "\n".join([f"* {link}" for link in links]) + for link in links: + message += f"* {link.preview_link}" + message += f" - ([before]({link.previous_link}))" + message += "\n" print(message) use_pr.as_issue().create_comment(message) diff --git a/typer/core.py b/typer/core.py index efc070b424..2caceed1cd 100644 --- a/typer/core.py +++ b/typer/core.py @@ -274,6 +274,7 @@ def __init__( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -414,6 +415,7 @@ def __init__( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], diff --git a/typer/models.py b/typer/models.py index 5d01ff185c..544e504761 100644 --- a/typer/models.py +++ b/typer/models.py @@ -174,6 +174,7 @@ def __init__( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -283,6 +284,7 @@ def __init__( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -411,6 +413,7 @@ def __init__( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], diff --git a/typer/params.py b/typer/params.py index 68f6afeea8..66c2b32d3e 100644 --- a/typer/params.py +++ b/typer/params.py @@ -20,6 +20,7 @@ def Option( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -85,6 +86,7 @@ def Option( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -148,6 +150,7 @@ def Option( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -269,6 +272,7 @@ def Argument( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -325,6 +329,7 @@ def Argument( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str], @@ -379,6 +384,7 @@ def Argument( is_eager: bool = False, envvar: Optional[Union[str, List[str]]] = None, # Note that shell_complete is not fully supported and will be removed in future versions + # TODO: Remove shell_complete in a future version (after 0.16.0) shell_complete: Optional[ Callable[ [click.Context, click.Parameter, str],