-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathpyproject.toml
More file actions
217 lines (199 loc) · 5.95 KB
/
Copy pathpyproject.toml
File metadata and controls
217 lines (199 loc) · 5.95 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
[build-system]
requires = ["setuptools>=60", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"
[project]
name = "linopy"
dynamic = ["version"]
description = "Linear optimization with N-D labeled arrays in Python"
readme = "README.md"
authors = [{ name = "Fabian Hofmann", email = "fabianmarikhofmann@gmail.com" }]
maintainers = [
{ name = "Fabian Hofmann", email = "fabianmarikhofmann@gmail.com" },
{ name = "Felix Bumann", email = "dev@fxbumann.de" },
]
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Typing :: Typed",
"Operating System :: OS Independent",
]
requires-python = ">=3.11"
dependencies = [
"numpy",
"scipy",
"bottleneck",
"toolz",
"numexpr",
"xarray>=2024.2.0",
"dask>=0.18.0",
"polars>=1.31.1",
"tqdm",
"deprecation",
"packaging",
]
[project.urls]
Homepage = "https://github.com/PyPSA/linopy"
Source = "https://github.com/PyPSA/linopy"
[project.optional-dependencies]
oetc = [
"google-cloud-storage",
"requests",
]
remote = [
"paramiko",
]
docs = [
"ipython==9.15.0",
"numpydoc==1.10.0",
"sphinx_rtd_theme==3.1.0",
"sphinx==9.0.4",
"sphinx_book_theme==1.2.0",
"sphinx-copybutton==0.5.2",
"nbsphinx==0.9.4",
"nbsphinx-link==1.3.0",
"docutils<0.21",
"numpy<2",
"gurobipy>=13.0.0",
"ipykernel==7.3.0",
"matplotlib==3.11.0",
"highspy>=1.7.1",
]
dev = [
"pytest",
"pytest-cov",
'mypy',
"pre-commit",
"netcdf4",
"paramiko",
"types-paramiko",
"types-requests",
"gurobipy",
"highspy",
"jupyter",
]
# Perf-relevant deps pinned exactly so run-to-run deltas reflect linopy
# changes, not dependency bumps.
benchmarks = [
"highspy==1.15.0",
"netcdf4==1.7.4",
"numpy==2.4.6",
"scipy==1.17.1",
"xarray==2026.4.0",
"pandas==3.0.3",
"polars==1.41.2",
"dask==2026.6.0",
"pytest==9.1.1",
"pytest-benchmark==5.2.3",
"pytest-memray==1.9.0",
"pytest-codspeed==5.0.3",
]
solvers = [
"gurobipy",
"highspy>=1.5.0,!=1.14.0; python_version < '3.12'",
"highspy>=1.7.1,!=1.14.0; python_version >= '3.12'",
"cplex; platform_system != 'Darwin'",
"mosek",
"mindoptpy",
"coptpy!=7.2.1",
"xpress; platform_system != 'Darwin'",
"pyscipopt; platform_system != 'Darwin'",
"knitro>=15.1.0",
# "cupdlpx>=0.1.2", pip package currently unstable
]
[tool.setuptools.packages.find]
include = ["linopy"]
[tool.setuptools.package-data]
"linopy" = ["py.typed"]
[tool.setuptools_scm]
write_to = "linopy/version.py"
version_scheme = "no-guess-dev"
[tool.pytest.ini_options]
testpaths = ["test"]
norecursedirs = ["dev-scripts", "doc", "examples", "benchmark", "benchmarks"]
markers = [
"gpu: marks tests as requiring GPU hardware (deselect with '-m \"not gpu\"')",
]
filterwarnings = [
# Silence our own EvolvingAPIWarning inside the test suite so the
# piecewise tests don't emit 500+ warnings. Users still see them.
# Match by message prefix on the builtin FutureWarning base class
# rather than on ``linopy.EvolvingAPIWarning`` directly — using the
# class reference here would force pytest to import linopy at
# config-parse time, which loads ``linopy.variables`` from
# site-packages and then conflicts with ``--doctest-modules``
# collection of ``linopy/variables.py`` in the source tree on
# Windows CI.
"ignore:piecewise:FutureWarning",
]
[tool.coverage.run]
branch = true
source = ["linopy"]
omit = ["test/*"]
[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:"]
[tool.mypy]
exclude = ['dev/*', 'examples/*', '^benchmark/', 'doc/*']
ignore_missing_imports = true
no_implicit_optional = true
warn_unused_ignores = true
show_error_code_links = true
disallow_untyped_defs = true
# disallow_any_generics = true
# warn_return_any = true
# [[tool.mypy.overrides]]
# module = "linopy.*"
# disallow_untyped_defs = true
[tool.ruff]
extend-include = ['*.ipynb']
[tool.ruff.lint]
select = [
'F', # pyflakes
'E', # pycodestyle: Error
'W', # pycodestyle: Warning
'I', # isort
'D', # pydocstyle
'UP', # pyupgrade
'TID', # flake8-tidy-imports
'NPY', # numpy
]
ignore = [
'E501', # line too long
'E741', # ambiguous variable names
'D105', # Missing docstring in magic method
'D212', # Multi-line docstring summary should start at the second line
'D200', # One-line docstring should fit on one line with quotes
'D401', # First line should be in imperative mood
'D404', # First word of the docstring should not be "This
'D413', # Missing blank line after last section
# pydocstyle ignores, which could be enabled in future when existing
# issues are fixed
'D100', # Missing docstring in public module
'D101', # Missing docstring in public class
'D102', # Missing docstring in public method
'D103', # Missing docstring in public function
'D106', # Missing docstring in public nested class
'D107', # Missing docstring in __init__
'D202', # No blank lines allowed after function docstring
'D203', # 1 blank line required before class docstring
'D205', # 1 blank line required between summary line and description
'D400', # First line should end with a period
'D415', # First line should end with a period, question mark, or exclamation point
'D417', # Missing argument descriptions in the docstring
]
[tool.ruff.lint.per-file-ignores]
"benchmark/notebooks/**.ipynb" = [
"F821", # undefined-name - e.g. "snakemake is undefined"
]
"benchmark/scripts/**.py" = [
"F821", # undefined-name - e.g. "snakemake is undefined"
]
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"