-
Notifications
You must be signed in to change notification settings - Fork 92
/
pyproject.toml
135 lines (117 loc) · 3.51 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
[build-system]
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "skltemplate"
dynamic = ["version"]
authors = [
{ name="Vighnesh Birodkar", email="[email protected]" },
{ name="Guillaume Lemaitre", email="[email protected]" },
]
description = "A template for scikit-learn compatible packages."
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"scikit-learn>=1.4.2",
]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
]
[project.urls]
Homepage = "https://github.com/scikit-learn-contrib/project-template"
Issues = "https://github.com/scikit-learn-contrib/project-template/issues"
[tool.setuptools_scm]
version_file = "skltemplate/_version.py"
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
[tool.pixi.dependencies]
python = ">=3.9"
scikit-learn = ">=1.4.2"
[tool.pixi.pypi-dependencies]
skltemplate = { path=".", editable=true }
[tool.pixi.feature.lint.dependencies]
# The version below should be aligned with the one of `.pre-commit-config.yaml`
black = "23.3.0"
pre-commit = "3.7.1"
ruff = "0.4.2"
[tool.pixi.feature.lint.tasks]
black = { cmd = "black --check --diff skltemplate && black --check --diff examples" }
ruff = { cmd = "ruff check --output-format=full skltemplate && ruff check --output-format=full examples" }
lint = { depends_on = ["black", "ruff"]}
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
[tool.pixi.feature.test.tasks]
test = { cmd = "pytest -vsl --cov=skltemplate --cov-report=xml skltemplate" }
[tool.pixi.feature.doc.dependencies]
matplotlib = "*"
numpydoc = "*"
pydata-sphinx-theme = "*"
setuptools-scm = ">=8" # needed for the versioning
sphinx = "*"
sphinx-design = "*"
sphinx-gallery = "*"
sphinx-prompt = "*"
[tool.pixi.feature.doc.tasks]
build-doc = { cmd = "make html", cwd = "doc" }
clean-doc = { cmd = "rm -rf _build", cwd = "doc" }
[tool.pixi.environments]
doc = ["doc"]
lint = ["lint"]
test = ["test"]
dev = ["doc", "lint", "test"]
[tool.black]
line-length = 88
target_version = ['py38', 'py39', 'py310']
preview = true
exclude = '''
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.vscode
)/
'''
force-exclude = "skltemplate/_version.py"
[tool.ruff]
# max line length for black
line-length = 88
target-version = "py38"
exclude=[
".git",
"__pycache__",
"dist",
"doc/_build",
"doc/auto_examples",
"build",
"skltemplate/_version.py",
]
[tool.ruff.lint]
# all rules can be found here: https://beta.ruff.rs/docs/rules/
select = ["E", "F", "W", "I"]
ignore=[
# space before : (needed for how black formats slicing)
"E203",
# do not assign a lambda expression, use a def
"E731",
# do not use variables named 'l', 'O', or 'I'
"E741",
]
[tool.ruff.lint.per-file-ignores]
# It's fine not to put the import at the top of the file in the examples
# folder.
"examples/*"=["E402"]
"doc/conf.py"=["E402"]
"doc/_templates/numpydoc_docstring.py"=["F821", "W292"]
[tool.pytest.ini_options]
addopts = "--doctest-modules --color=yes"
doctest_optionflags = "NORMALIZE_WHITESPACE"