Skip to content
Myr

pyproject.toml

This file

Path

pyproject.toml

216 lines · 6.6 KiB · TOML

Last changed by

✅ Use Ruff rules to ensure safe lazy-loading of `rich` (#1297)Nathan McDougallbefore adoption661b49e

History of this file

Take it

The walk stopped after 200 commits: lines older than 679318f point at it.

📝 Update release notesgithub-actionsbefore adoption679318f

lines 1–32why, one step back
1[build-system]
2requires = ["pdm-backend"]3build-backend = "pdm.backend"45[project]6name = "typer"7dynamic = ["version"]8description = "Typer, build great CLIs. Easy to code. Based on Python type hints."9authors = [10 {name = "Sebastián Ramírez", email = "tiangolo@gmail.com"},11]12requires-python = ">=3.7"13classifiers = [14 "Intended Audience :: Information Technology",15 "Intended Audience :: System Administrators",16 "Operating System :: OS Independent",17 "Programming Language :: Python :: 3",18 "Programming Language :: Python",19 "Topic :: Software Development :: Libraries :: Application Frameworks",20 "Topic :: Software Development :: Libraries :: Python Modules",21 "Topic :: Software Development :: Libraries",22 "Topic :: Software Development",23 "Typing :: Typed",24 "Development Status :: 4 - Beta",25 "Intended Audience :: Developers",26 "Programming Language :: Python :: 3 :: Only",27 "Programming Language :: Python :: 3.7",28 "Programming Language :: Python :: 3.8",29 "Programming Language :: Python :: 3.9",30 "Programming Language :: Python :: 3.10",31 "Programming Language :: Python :: 3.11",32 "Programming Language :: Python :: 3.12",

🔧 Add support for Python 3.13, tests in CI and add PyPI trove classifier (#1091)Edgar Ramírez Mondragónbefore adoption1332596

line 33why, one step back
33 "Programming Language :: Python :: 3.13",

📝 Update release notesgithub-actionsbefore adoption679318f

lines 34–36why, one step back
34 "License :: OSI Approved :: MIT License",
35]36dependencies = [

📌 Remove pin for Click < 8.3.0 now that there's a fix for the changes (#1346)Sebastián Ramírezbefore adoptiond0406c6

line 37why, one step back
37 "click >= 8.0.0",

📝 Update release notesgithub-actionsbefore adoption679318f

lines 38–166why, one step back
38 "typing-extensions >= 3.7.4.3",
39]40readme = "README.md"41[project.urls]42Homepage = "https://github.com/fastapi/typer"43Documentation = "https://typer.tiangolo.com"44Repository = "https://github.com/fastapi/typer"45Issues = "https://github.com/fastapi/typer/issues"46Changelog = "https://typer.tiangolo.com/release-notes/"4748[project.optional-dependencies]49standard = [50 "shellingham >=1.3.0",51 "rich >=10.11.0",52]5354[tool.pdm]55version = { source = "file", path = "typer/__init__.py" }56distribution = true5758[tool.pdm.build]59source-includes = [60 "tests/",61 "docs_src/",62 "requirements*.txt",63 "scripts/",64 ]6566[tool.tiangolo._internal-slim-build]67sync-dependencies = [68 "typer-slim[standard]",69 "typer-cli",70 "typer"71]7273[tool.tiangolo._internal-slim-build.packages.typer-slim.project]74name = "typer-slim"7576[tool.tiangolo._internal-slim-build.packages.typer]77include-optional-dependencies = ["standard"]7879[tool.tiangolo._internal-slim-build.packages.typer.project]80optional-dependencies = {}8182[tool.tiangolo._internal-slim-build.packages.typer.project.scripts]83typer = "typer.cli:main"8485[tool.tiangolo._internal-slim-build.packages.typer-cli.project]86name = "typer-cli"87readme = "typer-cli/README.md"88dependencies = [89 "typer",90]91optional-dependencies = {}9293[tool.tiangolo._internal-slim-build.packages.typer-cli.tool.pdm.build]94# excludes needs to explicitly exclude the top level python packages,95# otherwise PDM includes them by default96# A "*" glob pattern can't be used here because in PDM internals, the patterns are put97# in a set (unordered, order varies) and each excluded file is assigned one of the98# glob patterns that matches, as the set is unordered, the matched pattern could be "*"99# independent of the order here. And then the internal code would give it a lower score100# than the one for a default included file.101# By not using "*" and explicitly excluding the top level packages, they get a higher102# score than the default inclusion103excludes = ["typer", "tests", "pdm_build.py"]104# source-includes needs to explicitly define some value because PDM will check the105# truthy value of the list, and if empty, will include some defaults, including "tests",106# an empty string doesn't match anything, but makes the list truthy, so that PDM107# doesn't override it during the build.108source-includes = [""]109110[tool.pytest.ini_options]111addopts = [112 "--strict-config",113 "--strict-markers",114]115xfail_strict = true116junit_family = "xunit2"117filterwarnings = [118 "error",119 # For pytest-xdist120 'ignore::DeprecationWarning:xdist',121]122123[tool.coverage.run]124parallel = true125data_file = "coverage/.coverage"126source = [127 "docs_src",128 "tests",129 "typer"130]131omit = [132 "typer/_typing.py"133]134context = '${CONTEXT}'135relative_files = true136137[tool.coverage.report]138exclude_lines = [139 "pragma: no cover",140 "@overload",141 'if __name__ == "__main__":',142 "if TYPE_CHECKING:",143]144145[tool.mypy]146strict = true147148[[tool.mypy.overrides]]149module = "docs_src.*"150disallow_incomplete_defs = false151disallow_untyped_defs = false152disallow_untyped_calls = false153154[[tool.mypy.overrides]]155module = "shellingham"156ignore_missing_imports = true157158[tool.ruff.lint]159select = [160 "E", # pycodestyle errors161 "W", # pycodestyle warnings162 "F", # pyflakes163 "I", # isort164 "B", # flake8-bugbear165 "C4", # flake8-comprehensions166 "UP", # pyupgrade

✅ Use Ruff rules to ensure safe lazy-loading of `rich` (#1297)Nathan McDougallbefore adoption661b49e

line 167why, one step back
167 "TID", # flake8-tidy-imports

📝 Update release notesgithub-actionsbefore adoption679318f

lines 168–173why, one step back
168]
169ignore = [170 "E501", # line too long, handled by black171 "B008", # do not perform function calls in argument defaults172 "C901", # too complex173 "W191", # indentation contains tabs

✅ Use Ruff rules to ensure safe lazy-loading of `rich` (#1297)Nathan McDougallbefore adoption661b49e

line 174why, one step back
174 "TID252", # relative imports okay

📝 Update release notesgithub-actionsbefore adoption679318f

lines 175–178why, one step back
175]
176177[tool.ruff.lint.per-file-ignores]178# "__init__.py" = ["F401"]

✅ Use Ruff rules to ensure safe lazy-loading of `rich` (#1297)Nathan McDougallbefore adoption661b49e

lines 179–180why, one step back
179# rich_utils is allowed to use rich imports
180"typer/rich_utils.py" = ["TID251"]

📝 Update release notesgithub-actionsbefore adoption679318f

lines 181–198why, one step back
181# This file is more readable without yield from
182"docs_src/progressbar/tutorial004.py" = ["UP028", "B007"]183# Default mutable data structure184"docs_src/options_autocompletion/tutorial006_an.py" = ["B006"]185"docs_src/multiple_values/multiple_options/tutorial002_an.py" = ["B006"]186"docs_src/options_autocompletion/tutorial007_an.py" = ["B006"]187"docs_src/options_autocompletion/tutorial008_an.py" = ["B006"]188"docs_src/options_autocompletion/tutorial009_an.py" = ["B006"]189"docs_src/parameter_types/enum/tutorial003_an.py" = ["B006"]190# Loop control variable `value` not used within loop body191"docs_src/progressbar/tutorial001.py" = ["B007"]192"docs_src/progressbar/tutorial003.py" = ["B007"]193"docs_src/progressbar/tutorial005.py" = ["B007"]194"docs_src/progressbar/tutorial006.py" = ["B007"]195# Local variable `delete` is assigned to but never used196"docs_src/prompt/tutorial003.py" = ["F841"]197# Loop control variable `x` not used within loop body198"docs_src/using_click/tutorial001.py" = ["B007"]

✅ Use Ruff rules to ensure safe lazy-loading of `rich` (#1297)Nathan McDougallbefore adoption661b49e

lines 199–200why, one step back
199# No need to worry about rich imports in docs
200"docs_src/*" = ["TID"]

📝 Update release notesgithub-actionsbefore adoption679318f

lines 201–209why, one step back
201
202[tool.ruff.lint.isort]203known-third-party = ["typer", "click"]204# For docs_src/subcommands/tutorial003/205known-first-party = ["reigns", "towns", "lands", "items", "users"]206207[tool.ruff.lint.pyupgrade]208# Preserve types, even if a file imports `from __future__ import annotations`.209keep-runtime-typing = true

✅ Use Ruff rules to ensure safe lazy-loading of `rich` (#1297)Nathan McDougallbefore adoption661b49e

lines 210–216why, one step back
210
211[tool.ruff.lint.flake8-tidy-imports]212# Import rich_utils from within functions (lazy), not at the module level (TID253)213banned-module-level-imports = ["typer.rich_utils"]214215[tool.ruff.lint.flake8-tidy-imports.banned-api]216"rich".msg = "Use 'typer.rich_utils' instead of importing from 'rich' directly."