pyproject.toml 4.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[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.7",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
17
    "Programming Language :: Python :: 3.11",
18
    "Programming Language :: Python :: 3.12",
19
20
    "Topic :: Scientific/Engineering :: Artificial Intelligence"
]
21
dependencies = [
22
    "numpy>=1.17.0",
23
24
    "scipy"
]
25
description = "LightGBM Python-package"
26
27
28
29
30
31
license = {file = "LICENSE"}
maintainers = [
  {name = "Yu Shi", email = "yushi@microsoft.com"}
]
name = "lightgbm"
readme = "README.rst"
32
requires-python = ">=3.7"
33
version = "4.5.0.99"
34

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

51
52
53
54
55
56
57
58
59
[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]

60
requires = ["scikit-build-core>=0.10.1"]
61
62
63
64
65
build-backend = "scikit_build_core.build"

# based on https://github.com/scikit-build/scikit-build-core#configuration
[tool.scikit-build]

66
cmake.version = "CMakeLists.txt"
67
ninja.version = ">=1.11"
68
69
70
71
ninja.make-fallback = true
cmake.args = [
    "-D__BUILD_FOR_PYTHON:BOOL=ON"
]
72
build.verbose = false
73
cmake.build-type = "Release"
74
build.targets = ["_lightgbm"]
75
76
77
# stripping binaries should be turned back on once this is fixed:
# https://github.com/jameslamb/pydistcheck/issues/235
install.strip = false
78
79
80
81
logging.level = "INFO"
sdist.reproducible = true
wheel.py-api = "py3"
experimental = false
82
strict-config = false
83
minimum-version = "build-system.requires"
84
85
86

# end:build-system

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

92
93
94
95
96
97
[tool.ruff]
exclude = [
    "build",
    "compile",
    "external_libs",
    "lightgbm-python",
98
]
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
line-length = 120

# this should be set to the oldest version of python LightGBM supports
target-version = "py37"

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

[tool.ruff.lint]
117
118
119
120
ignore = [
    # (pydocstyle) Missing docstring in magic method
    "D105",
    # (pycodestyle) Line too long
121
122
123
124
125
126
127
128
129
130
131
    "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",
132
    # (pylint) for loop variable overwritten by assignment target
133
134
135
    "PLW2901",
    # (pylint) use 'elif' instead of 'else' then 'if', to reduce indentation
    "PLR5501"
136
137
138
139
140
141
142
143
]
select = [
    # flake8-bugbear
    "B",
    # flake8-comprehensions
    "C4",
    # pydocstyle
    "D",
144
    # pycodestyle (errors)
145
146
    "E",
    # pyflakes
147
    "F",
148
149
    # isort
    "I",
150
151
    # NumPy-specific rules
    "NPY",
152
153
    # pylint
    "PL",
154
155
156
157
158
159
    # flake8-return: unnecessary assignment before return
    "RET504",
    # flake8-simplify: use dict.get() instead of an if-else block
    "SIM401",
    # flake8-print
    "T",
160
161
    # pycodestyle (warnings)
    "W",
162
163
]

164
165
[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = [
166
    # (flake8-bugbear) raise exceptions with "raise ... from err"
167
168
169
170
    "B904",
    # (flake8-print) flake8-print
    "T"
]
171
172
"examples/*" = [
    # pydocstyle
173
174
175
    "D",
    # flake8-print
    "T"
176
]
177
178
179
180
"python-package/lightgbm/basic.py" = [
    # (pylint) Using the global statement is discouraged
    "PLW0603"
]
181
182
183
184
"tests/*" = [
    # (flake8-bugbear) Found useless expression
    "B018",
    # pydocstyle
185
186
187
    "D",
    # flake8-print
    "T"
188
189
]

190
[tool.ruff.lint.pydocstyle]
191
convention = "numpy"
192
193
194

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