[build-system] requires = ["pdm-backend"] build-backend = "pdm.backend" [project] name = "typer" license = "MIT" license-files = ["LICENSE"] dynamic = ["version"] description = "Typer, build great CLIs. Easy to code. Based on Python type hints." authors = [ {name = "Sebastián Ramírez", email = "tiangolo@gmail.com"}, ] requires-python = ">=3.10" classifiers = [ "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Libraries", "Topic :: Software Development", "Typing :: Typed", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", ] dependencies = [ "click >= 8.2.1", "shellingham >=1.3.0", "rich >=12.3.0", "annotated-doc >=0.0.2", ] readme = "README.md" [project.urls] Homepage = "https://github.com/fastapi/typer" Documentation = "https://typer.tiangolo.com" Repository = "https://github.com/fastapi/typer" Issues = "https://github.com/fastapi/typer/issues" Changelog = "https://typer.tiangolo.com/release-notes/" [project.scripts] typer = "typer.cli:main" [dependency-groups] dev = [ { include-group = "tests" }, { include-group = "docs" }, "prek >=0.3.2", ] docs = [ "cairosvg >=2.8.2", "griffe-typingdoc >=0.3.0", "griffe-warnings-deprecated >=1.1.0", "markdown-include-variants >=0.0.8", "mdx-include >=1.4.1", "mkdocs-macros-plugin >=1.5.0", "mkdocs-material >=9.7.1", "mkdocs-redirects >=1.2.1", "mkdocstrings[python] >=0.30.1", "pillow >=11.3.0", "pyyaml >=5.3.1", ] github-actions = [ "httpx >=0.27.0", "pydantic >=2.5.3", "pydantic-settings >=2.1.0", "pygithub >=2.3.0", "smokeshow >=0.5.0", ] tests = [ "coverage[toml] >=7.13", "mypy >=1.19.1", "ty >=0.0.25", "pytest >=9.0.0", "pytest-cov >=4.0.0", "pytest-sugar >=0.9.5", "pytest-xdist >=1.32.0", "rich >=12.3.0", "ruff >=0.15.0", "shellingham >=1.3.0", ] [tool.pdm] version = { source = "file", path = "typer/__init__.py" } distribution = true [tool.pdm.build] source-includes = [ "tests/", "docs_src/", "scripts/", ] [tool.pytest] minversion = "9.0" addopts = [ "--strict-config", "--strict-markers", ] strict_xfail = true filterwarnings = [ "error", # For pytest-xdist 'ignore::DeprecationWarning:xdist', ] [tool.coverage.run] parallel = true data_file = "coverage/.coverage" source = [ "docs_src", "tests", "typer" ] omit = [ "typer/_typing.py", ] context = '${CONTEXT}' relative_files = true [tool.coverage.report] exclude_lines = [ "pragma: no cover", "@overload", 'if __name__ == "__main__":', "if TYPE_CHECKING:", ] [tool.mypy] strict = true [[tool.mypy.overrides]] module = "docs_src.*" disallow_incomplete_defs = false disallow_untyped_defs = false disallow_untyped_calls = false [[tool.mypy.overrides]] module = "shellingham" ignore_missing_imports = true [tool.ruff.lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes "I", # isort "B", # flake8-bugbear "C4", # flake8-comprehensions "UP", # pyupgrade "TID", # flake8-tidy-imports ] ignore = [ "E501", # line too long, handled by black "B008", # do not perform function calls in argument defaults "C901", # too complex "W191", # indentation contains tabs "TID252", # relative imports okay ] [tool.ruff.lint.per-file-ignores] # "__init__.py" = ["F401"] # rich_utils is allowed to use rich imports "typer/rich_utils.py" = ["TID251"] # This file is more readable without yield from "docs_src/progressbar/tutorial004_py310.py" = ["UP028", "B007"] # Default mutable data structure "docs_src/options_autocompletion/tutorial006_an_py310.py" = ["B006"] "docs_src/multiple_values/multiple_options/tutorial002_an_py310.py" = ["B006"] "docs_src/options_autocompletion/tutorial007_an_py310.py" = ["B006"] "docs_src/options_autocompletion/tutorial008_an_py310.py" = ["B006"] "docs_src/options_autocompletion/tutorial009_an_py310.py" = ["B006"] "docs_src/parameter_types/enum/tutorial003_an_py310.py" = ["B006"] # Loop control variable `value` not used within loop body "docs_src/progressbar/tutorial001_py310.py" = ["B007"] "docs_src/progressbar/tutorial003_py310.py" = ["B007"] "docs_src/progressbar/tutorial005_py310.py" = ["B007"] "docs_src/progressbar/tutorial006_py310.py" = ["B007"] # Local variable `delete` is assigned to but never used "docs_src/prompt/tutorial003_py310.py" = ["F841"] # No need to worry about rich imports in docs "docs_src/*" = ["TID"] [tool.ruff.lint.isort] known-third-party = ["typer", "click"] # For docs_src/subcommands/tutorial003/ known-first-party = ["reigns", "towns", "lands", "items", "users"] [tool.ruff.lint.pyupgrade] # Preserve types, even if a file imports `from __future__ import annotations`. keep-runtime-typing = true [tool.ruff.lint.flake8-tidy-imports] # Import rich_utils from within functions (lazy), not at the module level (TID253) banned-module-level-imports = ["typer.rich_utils"] [tool.ruff.lint.flake8-tidy-imports.banned-api] "rich".msg = "Use 'typer.rich_utils' instead of importing from 'rich' directly." "shellingham.detect_shell".msg = """\ Use 'typer._completion_shared._get_shell_name' instead of using \ 'shellingham.detect_shell' directly. """ [tool.ty.terminal] error-on-warning = true