-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
248 lines (223 loc) · 10.2 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
# SPDX-License-Identifier: MIT
# Inspired by: https://hynek.me/articles/python-recursive-optional-dependencies/
# We here use a flat-layout distribution style https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
[build-system]
# never uppercap requirements unless we have evidence it won't work https://iscinumpy.dev/post/bound-version-constraints/
# cython cannot be placed in optional-dependencies, Cython won't be able to do its magic to make it importable in setup.py
# setuptools>=61 is necessary to support dynamic version in pyproject.toml: https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ -- but only setuptools up to 44.1.1 is available on Py2, so we define setuptools>44 as the highest version for Py2, and this works because on Py2, pyproject.toml is only used for build-system (because this table only exists in pyproject.toml, see PEP 518), and then pip/setuptools switch to setup.cfg on Py2 for the rest of the build process. For more infos on dependency specification, see: https://peps.python.org/pep-0508/
requires = ["setuptools>=44;python_version<'3'", "setuptools>=61;python_version>='3'"]
build-backend = "setuptools.build_meta"
[project] # beware if using setuptools: setup.py still gets executed, and even if pyproject.toml fields take precedence, if there is any code error in setup.py, building will fail!
name = "pyFileFixity"
dynamic = ["version"] # see PEP 440 https://peps.python.org/pep-0440/#pre-releases and https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
description = "Helping file fixity (long term storage of data) via redundant error correcting codes and hash auditing."
authors = [
{name = "Stephen Karl Larroque", email = "lrq3000@gmail.com"},
]
maintainers = [
{name = "Stephen Karl Larroque", email = "lrq3000@gmail.com"},
]
requires-python = ">=3.7"
license = {text = "MIT License"} # { file = "LICENSE" }
keywords = ["file", "repair", "monitor", "change", "reed-solomon", "error", "correction", "error correction", "parity", "parity files", "parity bytes", "data protection", "data recovery", "file protection", "qr codes", "qr code"]
classifiers = [
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'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 :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Archiving',
'Topic :: System :: Archiving :: Backup',
'Topic :: System :: Monitoring',
'Topic :: System :: Recovery Tools',
'Topic :: Utilities',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
]
dependencies = [
#"typing-extensions; python_version<'3.8'",
#"importlib_metadata;python_version<'3.8'",
"pathlib2",
"argparse",
"sortedcontainers",
"tqdm",
"distance",
"reedsolo>=2.0.0b1", # for Py3 (Py2 will use setup.cfg)
"unireedsolomon", # for Py3 (Py2 will use setup.cfg)
]
[tool.setuptools.dynamic]
version = {attr = "pyFileFixity.__version__"} # see: https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
[project.urls]
Homepage = "https://github.com/lrq3000/pyFileFixity"
Documentation = "https://github.com/lrq3000/pyFileFixity/blob/master/README.rst"
"Source" = "https://github.com/lrq3000/pyFileFixity"
Tracker = "https://github.com/lrq3000/pyFileFixity/issues"
Download = "https://github.com/lrq3000/pyFileFixity/releases"
#Changelog = "https://url/changelog"
[project.optional-dependencies]
# tests_require was deprecated in setup.py by setuptools, because anyway downstream the user wants to test in their own environment, not an isolated env, so the only practical replacement is to have test requirements defined as an extras/optional-dependency [test] so that they can be installed in the user's environment if they want to: https://discuss.python.org/t/providing-a-way-to-specify-how-to-run-tests-and-docs/15016
test = [ # minimum dependencies to run tests
"pytest",
"pytest-cov",
#"coveralls",
"py3make", # necessary to run the config files in tests/results/*.cfg
]
testmeta = [ # dependencies to test meta-data. Note that some of these dependencies make cibuildwheel choke on cryptography
"build",
"twine",
"validate-pyproject",
"rstcheck",
]
[project.readme]
# Do NOT use .. code:: python for interactive code session, otherwise syntax error due to prompt handle >>>, see https://svn.python.org/projects/external/Sphinx-1.2/doc/markup/code.rst and https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html#python-docstrings
# also use rstcheck
file = "README.rst"
content-type = "text/x-rst"
[project.scripts]
pff = "pyFileFixity.pff:main"
#[tool.setuptools]
#package-dir = {"" = "src"}
[tool.setuptools.packages.find]
# IMPORTANT: systematically delete `src/<project.name>.egg-info` folder before rebuilding, otherwise the list of included files will not get updated (it's in `SOURCES.txt` file in this folder)
where = [""]
include = ["pyFileFixity*"]
#exclude = ["pyFileFixity.lib.profilers"]
#namespaces = true
[tool.setuptools.package-data]
# Check the <mypkg>.egg-info/SOURCES.txt file generated after a `build` or `pip install` to check if the following files are correctly included in the sdist.
# Check also the list of files included by default: https://packaging.python.org/en/latest/guides/using-manifest-in/
"*" = [
"*.rst",
"LICENSE*",
"README*",
"*.pyx", # include the cython implementation sourcecode in the wheel, so that the user can cythonize later, this is necessary, it's not included by default even with extensions in setup.py
"*.c", # include the cythonized intermediary .c file for source distributions such as Gentoo, so that they do not need to install Cython v3 - no need since we use src-layout, it's automatically included
#"tests", # to help linux distros package builders, they may want to run the unit test to check their package is working OK - no need, tests folder is packaged by default in sdist nowadays
#"*tests/files/*", # this does NOT work, more than one level of folder is not supported this way, need to put in a separate line to define a package path, eg, "mypkg.tests" = ["files/*"].
#"*lib/*",
]
"pyFileFixity" = [
"ecc_specification.txt",
"resiliency_tester_config.txt",
]
#"pyFileFixity.tests" = [ # does NOt work, need MANIFEST.in, see: https://github.com/pypa/setuptools/issues/3341
# "files/*", # attach necessary files to run tests
# "results/*", # attach necessary py-make config and resulting database files to run and compare tests results
#]
#[tool.setuptools.exclude-package-data]
#"*" = [
# "docs/_build",
# "tests/__pycache__",
# "tests/.mypy_cache",
#]
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"-ra",
"--strict-markers",
]
xfail_strict = true
testpaths = "pyFileFixity/tests" # default path to look for tests if nothing is specified in commandline
filterwarnings = [
"once::Warning",
]
required_plugins = "pytest-cov"
[tool.coverage.run]
branch = true
relative_files = true
include = [
"pyFileFixity/lib/aux_funcs.py",
"pyFileFixity/lib/eccman.py",
"pyFileFixity/lib/hasher.py",
"pyFileFixity/lib/tee.py",
"pyFileFixity/_infos.py",
"pyFileFixity/header_ecc.py",
"pyFileFixity/repair_ecc.py",
"pyFileFixity/replication_repair.py",
"pyFileFixity/resiliency_tester.py",
"pyFileFixity/rfigc.py",
"pyFileFixity/structural_adaptive_ecc.py",
]
exclude = [
"pyFileFixity/tests/*",
"pyFileFixity/__init__.py",
"pyFileFixity/easy_profiler.py",
"pyFileFixity/ecc_speedtest.py",
"pyFileFixity/filetamper.py",
"pycleaner.py",
"setup.py",
]
[tool.coverage.paths]
source = ["pyFileFixity"]
[tool.coverage.report] # Beware: you need to delete .coveragerc if you have one, otherwise .coveragerc will take precedence!
show_missing = true
include = [
"*.py",
]
omit = [
"*/python?.?/*",
"*/site-packages/nose/*",
"*/opt/python/pypy*",
"*/tests/*",
]
exclude_lines = [
# a more strict default pragma
"\\# pragma: no cover\\b",
# allow defensive code
"^\\s*raise AssertionError\\b",
"^\\s*raise NotImplementedError\\b",
"^\\s*return NotImplemented\\b",
"^\\s*raise$",
# typing-related code
"^if (False|TYPE_CHECKING):",
": \\.\\.\\.(\\s*#.*)?$",
"^ +\\.\\.\\.$",
"-> ['\"]?NoReturn['\"]?:",
]
[tool.cibuildwheel]
#build = "*"
#skip = ""
#test-skip = ""
archs = ["auto"]
#build-frontend = "pip"
#dependency-versions = "pinned"
#environment = {""}
#environment-pass = []
build-verbosity = "1"
#before-all = ""
#before-build = ""
#repair-wheel-command = ""
test-command = "pytest {package}/tests"
#before-test = ""
#test-requires = []
test-extras = ["test"] # reuse the [test] extras optional dependencies to install test dependencies, instead of redefining in test-requires
#[tool.cibuildwheel.config-settings]
#--build-option = "--cythonize"
# NOTE: you have to use single-quoted strings in TOML for regular expressions.
# It's the equivalent of r-strings in Python. Multiline strings are treated as
# verbose regular expressions by Black. Use [ ] to denote a significant space
# character.
# While black is awesome, it does not support cython, so we avoid for the moment
# to keep a similar formatting between the pure python and the cython implementations.
# see: https://github.com/psf/black/issues/359
#[tool.black]
#line-length = 88
#target-version = ['py39', 'py310', 'py311']
#include = '\.pyi?$'
# We use preview style for formatting Black itself. If you
# want stable formatting across releases, you should keep
# this off.
#preview = false