-
Notifications
You must be signed in to change notification settings - Fork 85
/
pyproject.toml
145 lines (128 loc) Β· 4.65 KB
/
pyproject.toml
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
[tool.poetry]
name = "fact"
version = "1.0.0"
description = "Example Python project using best practices"
authors = ["John Hagen <johnthagen@users.noreply.github.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/johnthagen/python-blueprint"
documentation = "https://johnthagen.github.io/python-blueprint/"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Typing :: Typed",
# Include this classifier to prevent accidently publishing private code to PyPI.
# https://pypi.org/classifiers/
"Private :: Do Not Upload",
]
# For non-package/wheel application projects (e.g., FastAPI or Django app), you can omit the
# metadata above and replace it with:
# package-mode = false
[tool.poetry.dependencies]
# Some packages, such as scipy, constrain their upper bound of Python versions they support.
# Without also constraining the upper bound here, Poetry will not select those versions and will
# result in an old version being resolved/locked.
python = "^3.9, <3.14"
rich = "*"
typer-slim = { version = "*", extras = ["standard"] }
[tool.poetry.group.nox.dependencies]
nox-poetry = "*"
[tool.poetry.group.test.dependencies]
pytest = "*"
pytest-cov = "*"
pytest-randomly = "*"
[tool.poetry.group.type_check.dependencies]
mypy = "*"
# As of mypy 0.900, mypy no longer bundles the stubs for third-party libraries that reside
# in the typeshed project. Add these "types-" packages here if you depend on them in
# requirements.in (e.g. types-requests).
# See: http://mypy-lang.blogspot.com/2021/06/mypy-0900-released.html
# https://github.com/python/typeshed/tree/main/stubs
[tool.poetry.group.lint.dependencies]
ruff = "*"
[tool.poetry.group.docs.dependencies]
mkdocs-material = "*"
mkdocs-htmlproofer-plugin = "*"
mkdocstrings = { version = "*", extras = ["python"] }
# Autodoc.
mkdocs-gen-files = "*"
mkdocs-literate-nav = "*"
[tool.poetry.scripts]
fact = "fact.cli:app"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.mypy]
ignore_missing_imports = true
strict = true
# TODO: Remove this when explicit-override is enabled by default in strict mode
# https://github.com/python/mypy/issues/17511
enable_error_code = ["explicit-override"]
# If certain strict config options are too pedantic for a project,
# disable them selectively here by setting to false.
[tool.ruff]
line-length = 99
# TODO: Remove this when migrating to [project] requires-python field.
target-version = "py39"
src = ["src"]
# Ruff will automatically exclude all files listed in .gitignore as well as common temporary Python
# tool directories.
# To exclude additional folders, use extend-exclude.
[tool.ruff.lint]
select = [
"F", # pyflakes
"E", # pycodestyle
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"RUF", # ruff
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"PTH", # flake8-use-pathlib
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
]
# TODO: Remove ISC001 ignore when formatter updated: https://github.com/astral-sh/ruff/issues/8272
extend-ignore = ["RUF005", "RUF012", "ISC001"]
[tool.ruff.lint.isort]
force-sort-within-sections = true
split-on-trailing-comma = false
# For non-src directory projects, explicitly set top level package names:
# known-first-party = ["my-app"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["typer.Argument"]
[tool.pytest.ini_options]
addopts = [
"--strict-config",
"--strict-markers",
]
xfail_strict = true
filterwarnings = [
# When running tests, treat warnings as errors (e.g. -Werror).
# See: https://docs.pytest.org/en/latest/reference/reference.html#confval-filterwarnings
"error",
# Add additional warning supressions as needed here. For example, if a third-party library
# is throwing a deprecation warning that needs to be fixed upstream:
# "ignore::DeprecationWarning:typer",
]
[tool.coverage.run]
branch = true
# To globally exclude additional code blocks from code coverage reporting, see:
# https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion
#[tool.coverage.report]
#exclude_also = [
# "if TYPE_CHECKING:",
# "raise NotImplementedError",
#]