-
Notifications
You must be signed in to change notification settings - Fork 86
/
pyproject.toml
217 lines (194 loc) · 8.88 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
# SPDX-License-Identifier: Unlicense OR MIT-0
# Inspired by: https://hynek.me/articles/python-recursive-optional-dependencies/
# We here use a src-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
requires = ["setuptools>59", "cython>=3.0.0b2"]
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 = "reedsolo"
version = "2.1.2b1" # see PEP 440 https://peps.python.org/pep-0440/#pre-releases
description = "Pythonic universal errors-and-erasures Reed-Solomon codec to protect your data from errors and bitrot, with a future-proof zero-dependencies pure-python implementation and an optional speed-optimized Cython/C extension."
authors = [
{name = "Tomer Filiba", email = "[email protected]"},
{name = "Stephen Karl Larroque", email = "[email protected]"},
]
maintainers = [
{name = "Stephen Karl Larroque", email = "[email protected]"},
]
requires-python = ">=3.7"
license = { file = "LICENSE" }
keywords = ["data", "protection", "correction", "recovery", "restore", "save", "data-recovery", "reed-solomon", "error-correction-code", "qr", "qr-codes", "barcodes"]
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: The Unlicense (Unlicense)", # Unlicense OR MIT-0 at the user preference
"License :: OSI Approved :: MIT No Attribution License (MIT-0)",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"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 :: MicroPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Cython",
"Topic :: Communications",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Archiving",
"Topic :: System :: Archiving :: Backup",
"Topic :: System :: Recovery Tools",
"Topic :: Utilities",
]
dependencies = [
#"typing-extensions; python_version<'3.8'",
#"importlib_metadata;python_version<'3.8'",
]
[project.urls]
Homepage = "https://github.com/tomerfiliba-org/reedsolomon"
Documentation = "https://github.com/tomerfiliba-org/reedsolomon/blob/master/README.rst"
"Source" = "https://github.com/tomerfiliba-org/reedsolomon"
Tracker = "https://github.com/tomerfiliba-org/reedsolomon/issues"
Download = "https://github.com/tomerfiliba-org/reedsolomon/releases"
"Conda-Forge" = "https://anaconda.org/conda-forge/reedsolo"
#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",
"cython>=3.0.0b2",
]
testmeta = [ # dependencies to test meta-data. Note that some of these dependencies make cibuildwheel choke on cryptography
"build",
"twine",
"validate-pyproject",
"rstcheck",
]
testoptional = [ # dependencies for additional optional tests
"unireedsolomon"
]
#cythonize = [ # cython and other build time dependencies can NOT be defined as optional-dependencies nor extras, they are installed only after build! They need to be defined as build-system requirements. But it's possible to make it installable as an option given a config-setting arg, see: https://discuss.python.org/t/explicit-optional-cythonization-via-config-setting-post-pep517-and-install-option-deprecation/
# "cython>=3.0.0b2"
#]
[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"
#[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 = ["src"]
#exclude = ["test*"]
#namespaces = false
[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
]
#[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 = "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 = [
"*/reedsolo.py",
]
[tool.coverage.paths]
source = ["src"]
[tool.coverage.report] # Beware: you need to delete .coveragerc if you have one, otherwise .coveragerc will take precedence!
show_missing = true
include = [
"*/reedsolo.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 = {"REEDSOLO_CYTHONIZE: 1"}
#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