-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
240 lines (207 loc) · 6.06 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
[build-system]
# AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD!
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
# For smarter version schemes and other configuration options,
# check out https://github.com/pypa/setuptools_scm
version_scheme = "no-guess-dev"
[project]
name = "fast1dkmeans"
dynamic = ["version"]
authors = [{ name = "Felix I. Stamm", email = "[email protected]" }]
description = "A python package for optimal 1d k-means clustering."
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
]
keywords = ["clustering", "kmeans", "k-means"]
license = { file = "LICENSE" }
dependencies = ['numpy >= 1.23.5', 'numba >= 0.56.4']
[project.optional-dependencies]
test = ['pytest', 'pytest-cov', 'coverage[toml]']
[project.urls]
"Homepage" = "https://github.com/Feelx234/fast1dkmeans"
"Bug Tracker" = "https://github.com/Feelx234/fast1dkmeans/issues"
[tool.hatch.build]
exclude = ["notebooks", "figures", "old_notebooks"]
[tool.pytest.ini_options]
addopts = "-ra --cov --cov-report html --cov-report term-missing"
testpaths = ["./tests"]
pythonpath = ["src"]
[tool.coverage.run]
branch = true
source = ["src/fast1dkmeans"]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
"pragma: no cover",
"pragma: no branch okay",
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
"pass",
]
omit = [
"tests/*",
"src/fast1dkmeans/monge.py",
"src/fast1dkmeans/old_classes.py",
"src/fast1dkmeans/utils.py",
"src/fast1dkmeans/utils_for_test.py",
]
[tool.flake8]
# Some sane defaults for the code style checker flake8
max_line_length = 125
extend_ignore = ["E203", "W503", "E741"]
# ^ Black-compatible
# E203 and W503 have edge cases handled by black
exclude = [".tox", "build", "dist", ".eggs"]
[tool.isort]
profile = "black"
known_first_party = ["fast1dkmeans"]
# pytest --cov fast1dkmeans --cov-report html .
# git tag -a v0.1.0 -m "Publish version 0.1.0"
[tool.pylint.basic]
# Good variable names which should always be accepted, separated by a comma.
good-names = [
"D",
"T",
"D_row",
"S",
"A",
"F",
"H",
"F_vals",
"F_val",
"H_vals",
"Wilber",
"_Wilber",
"__Wilber",
"M",
"R",
"D",
"T",
"D_row",
"S",
"A",
"F",
"H",
"F_vals",
"F_val",
"H_vals",
"M",
"SMALL_VAL",
"LARGE_VAL",
"MicroaggWilberCalculator_edu",
"N_vals",
"N",
"setUp",
"tearDown",
]
# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs = ["^[_a-zGW][_a-z0-9L]?$"]
[tool.pylint.format]
max-line-length = 225
[tool.pylint."messages control"]
disable = [
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
"missing-final-newline",
"superfluous-parens",
]
[tool.pylint.main]
ignore = [".coveragerc"]
ignore-paths = [".coveragerc|.coveragerc"]
[tool.tox]
legacy_tox_ini = """
[tox]
minversion = 3.24
envlist = default
isolated_build = True
[testenv]
description = Invoke pytest to run automated tests
setenv =
TOXINIDIR = {toxinidir}
passenv =
HOME
SETUPTOOLS_*
extras =
test
commands =
pytest {posargs}
# # To run `tox -e lint` you need to make sure you have a
# # `.pre-commit-config.yaml` file. See https://pre-commit.com
# [testenv:lint]
# description = Perform static analysis and style checks
# skip_install = True
# deps = pre-commit
# passenv =
# HOMEPATH
# PROGRAMDATA
# SETUPTOOLS_*
# commands =
# pre-commit run --all-files {posargs:--show-diff-on-failure}
[testenv:{build,clean}]
description =
build: Build the package in isolation according to PEP517, see https://github.com/pypa/build
clean: Remove old distribution files and temporary build artifacts (./build and ./dist)
# https://setuptools.pypa.io/en/stable/build_meta.html#how-to-use-it
skip_install = True
changedir = {toxinidir}
deps =
build: build[virtualenv]
passenv =
SETUPTOOLS_*
commands =
clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]'
clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]'
build: python -m build {posargs}
# By default, both `sdist` and `wheel` are built. If your sdist is too big or you don't want
# to make it available, consider running: `tox -e build -- --wheel`
[testenv:{docs,doctests,linkcheck}]
description =
docs: Invoke sphinx-build to build the docs
doctests: Invoke sphinx-build to run doctests
linkcheck: Check for broken links in the documentation
passenv =
SETUPTOOLS_*
setenv =
DOCSDIR = {toxinidir}/docs
BUILDDIR = {toxinidir}/docs/_build
docs: BUILD = html
doctests: BUILD = doctest
linkcheck: BUILD = linkcheck
deps =
-r {toxinidir}/docs/requirements.txt
# ^ requirements.txt shared with Read The Docs
commands =
sphinx-build --color -b {env:BUILD} -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}
[testenv:publish]
description =
Publish the package you have been developing to a package index server.
By default, it uses testpypi. If you really want to publish your package
to be publicly accessible in PyPI, use the `-- --repository pypi` option.
skip_install = True
changedir = {toxinidir}
passenv =
# See: https://twine.readthedocs.io/en/latest/
TWINE_USERNAME
TWINE_PASSWORD
TWINE_REPOSITORY
TWINE_REPOSITORY_URL
deps = twine
commands =
python -m twine check dist/*
python -m twine upload {posargs:--repository {env:TWINE_REPOSITORY:testpypi}} dist/*
"""