pyproject.toml 4.76 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[project]

classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: MIT License",
    "Natural Language :: English",
    "Operating System :: MacOS",
    "Operating System :: Microsoft :: Windows",
    "Operating System :: POSIX",
    "Operating System :: Unix",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
15
    "Programming Language :: Python :: 3.11",
16
    "Programming Language :: Python :: 3.12",
17
    "Programming Language :: Python :: 3.13",
18
19
    "Topic :: Scientific/Engineering :: Artificial Intelligence"
]
20
dependencies = [
21
    "numpy>=1.17.0",
22
23
    "scipy"
]
24
description = "LightGBM Python-package"
25
26
27
28
29
30
license = {file = "LICENSE"}
maintainers = [
  {name = "Yu Shi", email = "yushi@microsoft.com"}
]
name = "lightgbm"
readme = "README.rst"
31
requires-python = ">=3.9"
32
version = "4.6.0.99"
33

34
[project.optional-dependencies]
35
36
37
38
arrow = [
    "cffi>=1.15.1",
    "pyarrow>=6.0.1"
]
39
40
41
42
43
44
45
dask = [
    "dask[array,dataframe,distributed]>=2.0.0",
    "pandas>=0.24.0"
]
pandas = [
    "pandas>=0.24.0"
]
46
47
48
49
plotting = [
    "graphviz",
    "matplotlib"
]
50
scikit-learn = [
51
    "scikit-learn>=0.24.2"
52
]
53

54
55
56
57
58
59
60
61
62
[project.urls]
homepage = "https://github.com/microsoft/LightGBM"
documentation = "https://lightgbm.readthedocs.io/en/latest/"
repository = "https://github.com/microsoft/LightGBM.git"
changelog = "https://github.com/microsoft/LightGBM/releases"

# start:build-system
[build-system]

63
requires = ["scikit-build-core>=0.10.1"]
64
65
66
67
build-backend = "scikit_build_core.build"

# based on https://github.com/scikit-build/scikit-build-core#configuration
[tool.scikit-build]
68
ninja.version = ">=1.11"
69
ninja.make-fallback = true
70
71
build.verbose = false
build.targets = ["_lightgbm"]
72
install.strip = true
73
74
75
76
logging.level = "INFO"
sdist.reproducible = true
wheel.py-api = "py3"
experimental = false
77
strict-config = false
78
minimum-version = "build-system.requires"
79

80
81
82
83
84
85
86
[tool.scikit-build.cmake]
version = "CMakeLists.txt"
build-type = "Release"

[tool.scikit-build.cmake.define]
__BUILD_FOR_PYTHON = "ON"

87
88
# end:build-system

89
[tool.mypy]
90
disallow_untyped_defs = true
91
92
93
exclude = 'build/*|compile/*|docs/*|examples/*|external_libs/*|lightgbm-python/*|tests/*'
ignore_missing_imports = true

94
95
96
97
98
99
100
101
102
[tool.rstcheck]
report_level = "WARNING"
ignore_directives = [
    "autoclass",
    "autofunction",
    "autosummary",
    "doxygenfile"
]

103
104
105
106
107
108
[tool.ruff]
exclude = [
    "build",
    "compile",
    "external_libs",
    "lightgbm-python",
109
]
110
111
112
line-length = 120

# this should be set to the oldest version of python LightGBM supports
113
target-version = "py39"
114
115
116
117
118
119
120
121
122
123
124

[tool.ruff.format]
docstring-code-format = false
exclude = [
    "build/*.py",
    "compile/*.py",
    "external_libs/*.py",
    "lightgbm-python/*.py",
]
indent-style = "space"
quote-style = "double"
125
skip-magic-trailing-comma = false
126
127

[tool.ruff.lint]
128
129
130
131
ignore = [
    # (pydocstyle) Missing docstring in magic method
    "D105",
    # (pycodestyle) Line too long
132
133
134
135
136
137
138
139
140
141
142
    "E501",
    # (pylint) Too many branches
    "PLR0912",
    # (pylint) Too many arguments in function definition
    "PLR0913",
    # (pylint) Too many statements
    "PLR0915",
    # (pylint) Consider merging multiple comparisons
    "PLR1714",
    # (pylint) Magic value used in comparison
    "PLR2004",
143
    # (pylint) for loop variable overwritten by assignment target
144
145
    "PLW2901",
    # (pylint) use 'elif' instead of 'else' then 'if', to reduce indentation
146
147
148
    "PLR5501",
    # (flake8-pytest-style) `scope='function'` is implied in `@pytest.fixture()`
    "PT003"
149
150
151
152
153
154
155
156
]
select = [
    # flake8-bugbear
    "B",
    # flake8-comprehensions
    "C4",
    # pydocstyle
    "D",
157
    # pycodestyle (errors)
158
159
    "E",
    # pyflakes
160
    "F",
161
162
    # isort
    "I",
163
164
    # NumPy-specific rules
    "NPY",
165
166
    # pylint
    "PL",
167
168
    # flake8-pytest-style
    "PT",
169
170
    # flake8-return: unnecessary assignment before return
    "RET504",
171
172
    # flake8-return: superfluous-else-raise
    "RET506",
173
174
175
176
    # flake8-simplify: use dict.get() instead of an if-else block
    "SIM401",
    # flake8-print
    "T",
177
178
    # pycodestyle (warnings)
    "W",
179
180
]

181
182
183
[tool.ruff.lint.flake8-pytest-style]
raises-extend-require-match-for = ["*Exception", "*Error"]

184
185
[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = [
186
    # (flake8-bugbear) raise exceptions with "raise ... from err"
187
188
189
190
    "B904",
    # (flake8-print) flake8-print
    "T"
]
191
192
"examples/*" = [
    # pydocstyle
193
194
195
    "D",
    # flake8-print
    "T"
196
]
197
198
199
200
"python-package/lightgbm/basic.py" = [
    # (pylint) Using the global statement is discouraged
    "PLW0603"
]
201
202
203
204
"tests/*" = [
    # (flake8-bugbear) Found useless expression
    "B018",
    # pydocstyle
205
206
207
    "D",
    # flake8-print
    "T"
208
209
]

210
[tool.ruff.lint.pydocstyle]
211
convention = "numpy"
212
213
214

[tool.ruff.lint.isort]
known-first-party = ["lightgbm"]