-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
322 lines (295 loc) · 9.8 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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# Core build system configuration
[build-system]
# Required packages for building the project
requires = [
# "scikit-build-core >= 0.9.10",
"setuptools_scm>=8", # For version management
"setuptools>=61.0.0", # For building the package
"pytest>=8.0.0", # For running tests
]
# build-backend = "scikit_build_core.build"
build-backend = "setuptools.build_meta"
[project]
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
name = "qc-BFit"
description = "Fitting a convex sum of Gaussian functions to any probability distribution."
readme = {file = 'README.md', content-type='text/markdown'}
requires-python = ">=3.9"
# "LICENSE" is name of the license file, which must be in root of project folder
license = {file = "LICENSE"}
authors = [
{name = "QC-Devs Community", email = "[email protected]"},
]
# Version managed by setuptools_scm
dynamic = ["version"]
# https://pypi.org/classifiers/
# Add PyPI classifiers here
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"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",
"Topic :: Scientific/Engineering",
]
[project.optional-dependencies]
docs = [
"sphinx>=2.3.0",
"numpydoc",
"sphinx_copybutton",
"sphinx-autoapi",
"nbsphinx",
"sphinx_rtd_theme"
]
# [project.scripts]
# # Command line interface entrypoint scripts
# # bfit = "bfit.__main__:main"
[project.urls]
homepage = "https://github.com/theochem/bfit"
documentation = "https://bfit.qcdevs.org/"
repository = "https://github.com/theochem/bfit"
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
# optional-dependencies = {dev = { file = ["requirements_dev.txt"] }}
[tool.setuptools_scm]
# can be empty if no extra settings are needed, presence enables setuptools-scm
[tool.setuptools]
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
platforms = ["Linux", "Windows", "MacOS"]
include-package-data = true
# This just means it's safe to zip up the bdist
zip-safe = true
# Non-code data that should be included in the package source code
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html
[tool.setuptools.package-data]
"bfit" = ["data/*/*.slater", "data/*/*.cat", "data/*/*.an", "data/*/*.nwchem", "data/ygbs"]
"bfit.test" = ["data/*/*.slater", "data/*/*.cat", "data/*/*.an", "data/*/*.nwchem"]
# Python modules and packages that are included in the
# distribution package (and therefore become importable)
[tool.setuptools.packages.find]
exclude = ["*/*/test", "test_*", "examples", "notebooks", "docs"]
# list of folders that contain the packages (["."] by default)
where = ["."]
# package names should match these glob patterns (["*"] by default)
include = ["bfit"]
# PDM example
#[tool.pdm.scripts]
#isort = "isort bfit"
#black = "black bfit"
#format = {composite = ["isort", "black"]}
#check_isort = "isort --check bfit tests"
#check_black = "black --check bfit tests"
#vulture = "vulture --min-confidence 100 bfit tests"
#ruff = "ruff check bfit tests"
#fix = "ruff check --fix bfit tests"
#codespell = "codespell --toml ./pyproject.toml"
#lint = {composite = ["vulture", "codespell", "ruff", "check_isort", "check_black"]}
#[tool.codespell]
## codespell supports pyproject.toml since version 2.2.2
## NOTE: the "tomli" package must be installed for this to work
## https://github.com/codespell-project/codespell#using-a-config-file
## NOTE: ignore words for codespell must be lowercase
#check-filenames = ""
#ignore-words-list = "word,another,something"
#skip = "htmlcov,.doctrees,*.pyc,*.class,*.ico,*.out,*.PNG,*.inv,*.png,*.jpg,*.dot"
[tool.black]
line-length = 100
# If you need to exclude directories from being reformatted by black
# force-exclude = '''
# (
# somedirname
# | dirname
# | filename\.py
# )
# '''
# https://beta.ruff.rs/docs
[tool.ruff]
line-length = 100
show-source = true
# Rules: https://beta.ruff.rs/docs/rules
# If you violate a rule, lookup the rule on the Rules page in ruff docs.
# Many rules have links you can click with a explanation of the rule and how to fix it.
# If there isn't a link, go to the project the rule was source from (e.g. flake8-bugbear)
# and review it's docs for the corresponding rule.
# If you're still confused, ask a fellow developer for assistance.
# You can also run "ruff rule <rule>" to explain a rule on the command line, without a browser or internet access.
select = [
"E", # pycodestyle
"F", # Pyflakes
"W", # Warning
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"EXE", # flake8-executable,
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"RET", # flake8-return
"TID", # flake8-tidy-imports
"ARG", # flake8-unused-arguments
"PGH", # pygrep-hooks
"PLC", # Pylint Convention
"PLE", # Pylint Errors
"PLW", # Pylint Warnings
"RUF", # Ruff-specific rules
# ** Things to potentially enable in the future **
# DTZ requires all usage of datetime module to have timezone-aware
# objects (so have a tz argument or be explicitly UTC).
# "DTZ", # flake8-datetimez
# "PTH", # flake8-use-pathlib
# "SIM", # flake8-simplify
]
# Files to exclude from linting
extend-exclude = [
"*.pyc",
"__pycache__",
"*.egg-info",
".eggs",
# check point files of jupyter notebooks
"*.ipynb_checkpoints",
".tox",
".git",
"build",
"dist",
"docs",
"examples",
"htmlcov",
"notebooks",
".cache",
"_version.py",
]
# Linting error codes to ignore
ignore = [
"F403", # unable to detect undefined names from star imports
"F405", # undefined locals from star imports
"W605", # invalid escape sequence
"A003", # shadowing python builtins
"RET505", # unnecessary 'else' after 'return' statement
"RET504", # Unnecessary variable assignment before return statement
"RET507", # Unnecessary {branch} after continue statement
"PT011", # pytest-raises-too-broad
"PT012", # pytest.raises() block should contain a single simple statement
"PLW0603", # Using the global statement to update is discouraged
"PLW2901", # for loop variable overwritten by assignment target
"G004", # Logging statement uses f-string
"PIE790", # no-unnecessary-pass
"PIE810", # multiple-starts-ends-with
"PGH003", # Use specific rule codes when ignoring type issues
"PLC1901", # compare-to-empty-string
]
# Linting error codes to ignore on a per-file basis
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401", "E501"]
"bfit/somefile.py" = ["E402", "E501"]
"bfit/somedir/*" = ["E501"]
# Configuration for mypy
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
[tool.mypy]
python_version = "3.9"
follow_imports = "skip"
ignore_missing_imports = true
files = "bfit" # directory mypy should analyze
# Directories to exclude from mypy's analysis
exclude = [
"book",
]
# Configuration for pytest
# https://docs.pytest.org/en/latest/reference/customize.html#pyproject-toml
[tool.pytest.ini_options]
addopts = [
# Allow test files to have the same name in different directories.
"--import-mode=importlib",
"--cache-clear",
"--showlocals",
"-v",
"-r a",
"--cov-report=term-missing",
"--cov=bfit",
]
# directory containing the tests
testpaths = [
"bfit/test",
]
norecursedirs = [
".vscode",
"__pycache__",
"build",
]
# Warnings that should be ignored
filterwarnings = [
"ignore::DeprecationWarning"
]
# custom markers that can be used using pytest.mark
markers = [
"slow: lower-importance tests that take an excessive amount of time",
]
# Configuration for coverage.py
[tool.coverage.run]
# files or directories to exclude from coverage calculations
omit = [
'bfit/test/*',
]
# Configuration for vulture
[tool.vulture]
# Files or directories to exclude from vulture
# The syntax is a little funky
# exclude = [
# "somedir",
# "*somefile.py",
# ]
# configuration for bandit
[tool.bandit]
exclude_dirs = [
"bfit/test",
]
skips = [
"B101", # Ignore assert statements
"B311", # Ignore pseudo-random generators
"B404", # Ignore subprocess import
"B603", # Ignore subprocess call
"B607", # Ignore subprocess call
]
[tool.pylint.MASTER]
ignore-patterns = [
"test_.*\\.py$",
".*_test\\.py$"
]
ignore-paths = [
"tests/.*",
".*/tests/.*"
]
[tool.pylint.messages_control]
# Pylint configuration
max-line-length = 100
# ignore
# List of message identifiers to ignore, separated by a comma.
disable=[
"fixme", # Disable fixme messages
"too-many-positional-arguments", # Disable too many positional arguments
"too-many-locals", # Disable too many locals
"too-many-instance-attributes", # Disable too many instance attributes
"too-many-positional-arguments", # Disable too many positional arguments
"missing-class-docstring", # Disable missing class docstring
"too-few-public-methods", # Disable too few public methods
"protected-access", # Disable protected access
"too-many-lines", # Disable too many lines
"possibly-used-before-assignment",
"too-many-branches",
"too-many-arguments",
"no-else-return",
"too-many-statements",
]