-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
176 lines (161 loc) · 4.05 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "coreax"
dynamic = ["version"]
description = "Jax coreset algorithms."
readme = "README.md"
requires-python = ">=3.9"
keywords = [
"coreset",
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
]
license = {file = "LICENSE"}
authors = [
{name = "GCHQ", email = "[email protected]"},
]
dependencies = [
"equinox<0.11.8", # 0.11.8 raises TypeErrors of the form
# `__class__ assignment: 'x' object layout differs from 'x'`.
"flax",
"jax",
"jaxopt",
"jaxtyping",
"optax",
"scikit-learn",
"tqdm",
"typing-extensions",
]
[project.optional-dependencies]
# Benchmarking
benchmark = [
"torch",
"torchvision",
"umap-learn>=0.5.7",
# Required for umap-learn
"llvmlite>=0.40.0",
]
# Run unit tests with coverage assessment
test = [
"coreax[benchmark]",
"imageio",
"matplotlib",
"numpy",
"opencv-python-headless", # WARNING: Incompatible with other versions of opencv
"pytest-cov",
"pytest-rerunfailures",
"scipy",
]
# Compile documentation
doc = [
"furo",
"sphinx",
"sphinx-autodoc-typehints",
"sphinx-toolbox",
"sphinxcontrib-bibtex",
"sphobjinv",
]
[dependency-groups]
# All tools for a developer including those for running pylint
dev = [
"coreax[benchmark, doc, test]",
"jupyter",
"ruff",
"pre-commit>=3.7",
"pylint",
"pyright",
"pyroma",
]
[tool.uv]
# Ensure we get the latest package versions available for each Python version
environments = [
"python_version>='3.13'",
"python_version=='3.12.*'",
"python_version=='3.11.*'",
"python_version=='3.10.*'",
"python_version=='3.9.*'",
]
[project.urls]
Documentation = "https://coreax.readthedocs.io/en/latest/"
Repository = "https://github.com/gchq/coreax"
Issues = "https://github.com/gchq/coreax/issues"
Changelog = "https://github.com/gchq/coreax/blob/main/CHANGELOG.md"
[tool.setuptools]
packages = [
"coreax",
"coreax.kernels",
"coreax.solvers",
]
[tool.setuptools.dynamic]
version = {attr = "coreax.__version__"}
[tool.ruff]
src = [".", "examples"]
[tool.ruff.lint]
preview = true
select = [
"B", # flake8-bugbear
"C90", # McCabe
"D", # pydocstyle
"E", # pycodestyle [error]
"F", # pyflakes
"G010", # logging-warn
"I", # isort
"N", # pep8-naming
"PGH005", # invalid-mock-access
"PL", # pylint
"S102", # exec-builtin
"S307", # suspicious-eval-usage
"W", # pycodestyle [warning]
]
ignore = [
# Incompatible with ruff format
"D206", # indent-with-spaces
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"W191", # tab-indentation
# Incompatible with other pydocstyle rules
"D203", # one-blank-line-before-class
"D212", # multi-line-summary-first-line
# Incompatible with jaxtyping
"F722", # forward-annotation-syntax-error
# Opinionated ignores
"PLR6301", # no-self-use (opinionated)
]
[tool.ruff.lint.per-file-ignores]
"coreax/__init__.py" = ["F401"]
"documentation/source/conf.py" = ["E402"]
"documentation/source/snippets/*" = ["D100", "F821"]
"examples/*" = ["PLR0914", "PLR0915"]
"tests/*" = ["D102", "D200", "PLR0904"]
[tool.ruff.lint.pylint]
max-args = 10
max-locals = 20
allow-dunder-method-names = ["__check_init__", "__jax_array__"]
[tool.ruff.lint.isort]
combine-as-imports = true
force-wrap-aliases = true
[tool.coverage.run]
command_line = "-m pytest tests/unit --cov"
branch = true
relative_files = true
source = ["coreax"]
[tool.coverage.report]
show_missing = true
sort = "Cover"
exclude_also = [
"pass",
"raise RuntimeError",
"if TYPE_CHECKING:",
"raise$",
"..."
]