1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
name = "typer"
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.8"
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.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"click >= 8.0.0",
"typing-extensions >= 3.7.4.3",
]
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.optional-dependencies]
standard = [
"shellingham >=1.3.0",
"rich >=10.11.0",
]
[tool.pdm]
version = { source = "file", path = "typer/__init__.py" }
distribution = true
[tool.pdm.build]
source-includes = [
"tests/",
"docs_src/",
"requirements*.txt",
"scripts/",
]
[tool.tiangolo._internal-slim-build]
sync-dependencies = [
"typer-slim[standard]",
"typer-cli",
"typer"
]
[tool.tiangolo._internal-slim-build.packages.typer-slim.project]
name = "typer-slim"
[tool.tiangolo._internal-slim-build.packages.typer]
include-optional-dependencies = ["standard"]
[tool.tiangolo._internal-slim-build.packages.typer.project]
optional-dependencies = {}
[tool.tiangolo._internal-slim-build.packages.typer.project.scripts]
typer = "typer.cli:main"
[tool.tiangolo._internal-slim-build.packages.typer-cli.project]
name = "typer-cli"
readme = "typer-cli/README.md"
dependencies = [
"typer",
]
optional-dependencies = {}
[tool.tiangolo._internal-slim-build.packages.typer-cli.tool.pdm.build]
# excludes needs to explicitly exclude the top level python packages,
# otherwise PDM includes them by default
# A "*" glob pattern can't be used here because in PDM internals, the patterns are put
# in a set (unordered, order varies) and each excluded file is assigned one of the
# glob patterns that matches, as the set is unordered, the matched pattern could be "*"
# independent of the order here. And then the internal code would give it a lower score
# than the one for a default included file.
# By not using "*" and explicitly excluding the top level packages, they get a higher
# score than the default inclusion
excludes = ["typer", "tests", "pdm_build.py"]
# source-includes needs to explicitly define some value because PDM will check the
# truthy value of the list, and if empty, will include some defaults, including "tests",
# an empty string doesn't match anything, but makes the list truthy, so that PDM
# doesn't override it during the build.
source-includes = [""]
[tool.pytest.ini_options]
addopts = [
"--strict-config",
"--strict-markers",
]
xfail_strict = true
junit_family = "xunit2"
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.py" = ["UP028", "B007"]
# Default mutable data structure
"docs_src/options_autocompletion/tutorial006_an.py" = ["B006"]
"docs_src/multiple_values/multiple_options/tutorial002_an.py" = ["B006"]
"docs_src/options_autocompletion/tutorial007_an.py" = ["B006"]
"docs_src/options_autocompletion/tutorial008_an.py" = ["B006"]
"docs_src/options_autocompletion/tutorial009_an.py" = ["B006"]
"docs_src/parameter_types/enum/tutorial003_an.py" = ["B006"]
# Loop control variable `value` not used within loop body
"docs_src/progressbar/tutorial001.py" = ["B007"]
"docs_src/progressbar/tutorial003.py" = ["B007"]
"docs_src/progressbar/tutorial005.py" = ["B007"]
"docs_src/progressbar/tutorial006.py" = ["B007"]
# Local variable `delete` is assigned to but never used
"docs_src/prompt/tutorial003.py" = ["F841"]
# Loop control variable `x` not used within loop body
"docs_src/using_click/tutorial001.py" = ["B007"]
# 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."
|