-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
205 lines (190 loc) · 5.3 KB
/
Copy pathpyproject.toml
File metadata and controls
205 lines (190 loc) · 5.3 KB
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
[build-system]
requires = ["setuptools>=84.0.0", "setuptools_scm>=10.2.1"]
build-backend = "setuptools.build_meta"
[project]
name = "your-package-name"
dynamic = ["version"]
requires-python = ">=3.11"
dependencies = []
authors = [{ name = "Your Name", email = "you@example.com" }]
description = "A short description of your package"
keywords = []
license = "MIT"
license-files = ["LICENSE"]
readme = "README.md"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
[project.urls]
Documentation = "https://example.com/your-package-name"
Source = "https://github.com/your-org/your-package-name"
Issues = "https://github.com/your-org/your-package-name/issues"
# [project.scripts]
# your-command = "your_package_name.cli:main"
[dependency-groups]
dev = [
"check-manifest",
"check-wheel-contents",
"deptry",
"pre-commit",
"ruff",
"setuptools-scm",
"twine",
"ty",
"vulture",
"zizmor",
]
test = [
"pytest",
"pytest-cov",
"pytest-timeout",
"pytest-xdist",
]
test-extras = [
"freezegun",
"hypothesis",
"pytest-env",
"pytest-ordering",
"pytest-randomly",
"pytest-rerunfailures",
"pytest-runner",
"pytest-sugar",
"pytest-vcr",
]
docs = [
"sphinx",
"sphinx-autobuild",
"sphinxcontrib-mermaid",
"sphinx_copybutton",
"myst-parser",
"sphinx-palewire-theme>=0.1.10",
]
notebooks = [
"jupyterlab",
"ipywidgets",
"rich",
"pandas",
"pyarrow",
"xlrd",
"openpyxl",
"altair",
]
# Adopt a src/ layout when adding a library:
# [tool.setuptools.package-dir]
# "" = "src"
#
# [tool.setuptools.packages.find]
# where = ["src"]
[tool.setuptools_scm]
[tool.ruff]
target-version = "py311"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"B", # flake8-bugbear
"C4", # flake8-comprehensions - comprehension improvements
"DTZ", # flake8-datetimez - timezone-aware datetimes
"G", # flake8-logging-format - logging formatting
"LOG", # flake8-logging - logging best practices
"W", # pycodestyle warnings
"I", # isort - import sorting
"UP", # pyupgrade - modern Python idioms
"N", # pep8-naming - naming conventions
"ANN", # flake8-annotations - type annotations
"YTT", # flake8-2020 - sys.version_info checks
"S", # flake8-bandit - security issues
"BLE", # flake8-blind-except - blind except statements
"FA", # flake8-future-annotations - future annotations
"ICN", # flake8-import-conventions - import conventions
"PIE", # flake8-pie - misc lints
"Q", # flake8-quotes - quote consistency
"RSE", # flake8-raise - raise statement improvements
"RET", # flake8-return - return statement improvements
"SLOT", # flake8-slots - __slots__ usage
"SIM", # flake8-simplify - code simplification
"TID", # flake8-tidy-imports - tidy imports
"PTH", # flake8-use-pathlib - pathlib usage
"PT", # flake8-pytest-style - pytest conventions
"TC", # flake8-type-checking - type-only imports
"FLY", # flynt - f-string conversion
"PERF", # perflint - performance improvements
"RUF", # ruff-specific rules
]
ignore = [
"E501", # Line length
"UP046", # Generic class `Loader` uses `Generic` subclass instead of type parameters
"S101", # Allow assert
"SIM103", # Allow for True/False returns after a test
"SIM108", # Don't force ternary expressions
"SIM117", # Allow for nested with statements
"PERF401", # For for appending to a list
"RUF001", # Allow for curly quotes
"RUF005", # Allow for adding lists
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"ANN", # Annotations
"S105", # Possible hardcoded password
"S108", # Temp directory
]
[tool.ruff.format]
docstring-code-format = true
[tool.pytest.ini_options]
addopts = [
"--strict-config",
"--strict-markers",
"--durations=10",
"--durations-min=1.0",
]
testpaths = ["tests"]
python_files = "test_*.py"
timeout = 60
xfail_strict = true
markers = [
"unit: Unit tests",
"component: Component tests",
"integration: Integration tests",
"e2e: End-to-end tests",
]
filterwarnings = [
"ignore::DeprecationWarning:pandas.*",
"ignore::FutureWarning:numpy.*",
"ignore::DeprecationWarning:dateutil.*",
]
[tool.coverage.run]
# Set source = ["your_package_name"] after adding the library package.
branch = true
relative_files = true
omit = ["*/__pycache__/*"]
[tool.ty.environment]
python-version = "3.11"
[tool.ty.src]
# Set include = ["src/your_package_name"] after adding the library package.
exclude = [
"tests/**",
"build/**",
".venv/**",
".github/**",
".vscode/**",
"**/__pycache__",
]
[tool.ty.rules]
invalid-argument-type = "error"
invalid-return-type = "error"
invalid-key = "error"
invalid-assignment = "error"
invalid-method-override = "error"
unresolved-attribute = "error"
possibly-missing-attribute = "error"
missing-type-argument = "error"
no-matching-overload = "error"
unsound-return-statement = "error"
possibly-unresolved-reference = "warn"
unused-ignore-comment = "error"