-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
221 lines (192 loc) · 5.34 KB
/
Copy pathpyproject.toml
File metadata and controls
221 lines (192 loc) · 5.34 KB
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
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "toyml"
version = "0.4.0"
description = "ToyML: Machine Learning from Scratch"
keywords=["machine learning", "statistics", "engineering"]
license = {text = "Apache 2.0"}
readme = "README.md"
authors = [
{name = "Xiangzhuang Shen", email = "datahonor@gmail.com"},
]
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
]
requires-python = ">= 3.10"
dependencies = []
[tool.uv]
default-groups = ["dev", "docs", "plot"]
[dependency-groups]
dev = [
"pre-commit",
"ipython",
"mypy",
"ruff",
"pytest",
"pytest-cov",
"hypothesis>=6.112.0",
"scikit-learn",
"numpy>=2.1.1",
]
docs = [
"mkdocs",
"mkdocs-material",
"mkdocs-material-extensions",
"mkdocs-bibtex",
"mkdocstrings-python",
"mkdocs-autorefs",
"mkdocs-git-committers-plugin-2",
"mkdocs-git-revision-date-localized-plugin",
]
plot = [
"matplotlib",
"networkx",
"scipy",
]
[project.urls]
"Homepage" = "https://github.com/ai-glimpse/toyml"
"Bug Tracker" = "https://github.com/ai-glimpse/toyml/issues"
"Documentation" = "https://ai-glimpse.github.io/toyml/"
"Source Code" = "https://github.com/ai-glimpse/toyml"
"Release Notes" = "https://ai-glimpse.github.io/toyml/changelog/"
[tool.setuptools]
zip-safe = true
include-package-data = true
[tool.setuptools.packages.find]
include = ["toyml*"]
namespaces = false
[tool.setuptools.package-data]
"*" = ["py.typed"]
[tool.mypy]
ignore_missing_imports = true
strict = true
exclude = ["scripts"]
[tool.pytest.ini_options]
addopts = "-v --cov=toyml --cov-fail-under 90 --cov-report=term --cov-report=xml --cov-report=html"
testpaths = [
"tests",
]
[tool.coverage.report]
exclude_lines = [
'pragma: no cover',
'raise AssertionError',
'raise NotImplementedError',
'if __name__ == .__main__.:',
'def __repr__',
]
fail_under = 90
precision = 1
skip_empty = true
sort = "-Cover"
# Ruff configuration: https://docs.astral.sh/ruff/configuration/#configuring-ruff
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
# Same as Black.
line-length = 120
indent-width = 4
# Assume Python 3.11
target-version = "py310"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"S101", # assert
"PLC0415",
"PLR2004", # Magic value used in comparison,
"S311", # Standard pseudo-random generators are not suitable for security/cryptographic purposes
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # undocumented-public-init
"T201", # print
"RET504", # Unnecessary assignment before `return` statement
"ERA001", # Found commented-out code
"PLR0913", # Too many arguments in function definition
"RUF003" # Comment contains ambiguous(FULLWIDTH COMMA)
]
pydocstyle = { convention = "google" }
[tool.ruff.lint.per-file-ignores]
'tests/*' = [
"SLF001", # Private member accessed
"S101", # assert
"PT009", # Use a regular `assert` instead of unittest-style `assertEqual`
"INP001",
]
'examples/*' = [
"INP001", # Private member accessed
]
'scripts/*' = [
"INP001", # Private member accessed
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
exclude = [
"COM812",
]
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = true
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"