-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathpyproject.toml
More file actions
230 lines (191 loc) · 6.82 KB
/
Copy pathpyproject.toml
File metadata and controls
230 lines (191 loc) · 6.82 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
222
223
224
225
226
227
228
229
230
[tool.pytest.ini_options]
minversion = "6.0"
# opts:
# `--dist=loadscope ` - run tests within classes in series
# `--strict-markers` - Raise error on unexpected pytest markers being used (add new markers to `markers` config)
# `-nauto` - parallelise over as many threads as possible (uses pytest-xdist). If debugging (`--pdb`), this will default to one thread.
# `--cov-report=xml --cov-config=pyproject.toml` - coverage report config for when running in tests (uses pytest-cov; call `--cov` in CLI to switch coverage on; `--cov-config` include to avoid bug)
addopts = "-rav --dist=loadscope --strict-markers -nauto --cov-report=xml --cov-config=pyproject.toml -m 'not needs_gurobi_license' --pdbcls=IPython.terminal.debugger:Pdb "
testpaths = ["tests"]
# to mark a test, decorate it with `@pytest.mark.[marker-name]`
markers = ["serial", "time_intensive", "needs_gurobi_license"]
filterwarnings = [
# https://github.com/pytest-dev/pytest-xdist/issues/825
"ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning",
"ignore:(?s).*datetime.datetime.utcfromtimestamp():",
"ignore:(?s).*Pyarrow will become a required dependency of pandas:DeprecationWarning",
"ignore:.*The return type of `Dataset.dims` will be changed to return a set of dimension names.*:FutureWarning",
"ignore:.*Mismatched null-like values None and nan found.*:FutureWarning"
]
[tool.coverage.run]
branch = true
source = ["src/"]
[tool.coverage.html]
directory = "reports/coverage"
[tool.coverage.xml]
output = "reports/coverage/coverage.xml"
[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:",
'if importlib.util.find_spec\("(gurobipy|highspy)"\) is not None',
"@overload",
]
[tool.ruff]
line-length = 88
[tool.ruff.format]
exclude = [".*.egg-info", "requirements/**"]
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = ["E", "F", "I", "Q", "W", "D", "PT", "UP"]
# line too long; Black will handle these
ignore = ["E501"]
[tool.ruff.lint.isort]
split-on-trailing-comma = false
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
# Ignore `E402` (import violations) and `F401` (unused imports) in all `__init__.py` files
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401", "D104"]
"*.ipynb" = ["E402"]
"tests/*" = ["D"]
"docs/examples/*" = ["D"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pycodestyle]
max-doc-length = 200
ignore-overlong-task-comments = true
[tool.codespell]
skip = 'tests/*.py,AUTHORS,pixi.lock'
count = ''
quiet-level = 3
ignore-words-list = "socio-economic" # British english spelling that isn't covered by the inbuilt dictionary
[tool.mypy]
ignore_missing_imports = true
files = "src/"
[project]
name = "calliope"
authors = [
{ name = "Calliope contributors listed in AUTHORS", email = "stefan@pfenninger.org" },
]
maintainers = [
{ name = "Stefan Pfenninger", email = "stefan@pfenninger.org" },
{ name = "Bryn Pickering", email = "17178478+brynpickering@users.noreply.github.com" },
]
description = "A multi-scale energy systems modelling framework."
readme = "README.md"
requires-python = ">=3.12"
keywords = ["energy systems", "optimisation", "mathematical programming"]
license = "Apache-2.0"
license-files = ["LICENSE", "CITATION"]
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
]
dynamic = ["version"]
dependencies = [
"bottleneck >= 1",
"click >= 8",
"geographiclib >= 2",
"highspy >= 1.15",
"ipdb >= 0.13",
"ipykernel >= 6",
"jinja2 >= 3",
"jsonref >= 1.1",
"jsonschema >= 4",
"natsort >= 8",
"netcdf4 >= 1.2",
"numpy >= 2.0",
"pandas >= 2.1.3",
"pyomo >= 6.8.2",
"pyparsing >= 3.2",
"ruamel.yaml >= 0.18",
"xarray >= 2026.4",
"pydantic >= 2.11.4",
]
[tool.hatch.build]
skip-excluded-dirs = true
[tool.hatch.build.targets.sdist]
only-include = ["src", "LICENSE", "CITATION", "AUTHORS", "README.md"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/calliope/_version.py"
[project.scripts]
calliope = "calliope.cli:cli"
[project.urls]
website = "https://www.callio.pe/"
repository = "https://github.com/calliope-project/calliope"
documentation = "https://calliope.readthedocs.io"
changelog = "https://github.com/calliope-project/calliope/changelog.rst"
[tool.pixi.workspace]
channels = ["conda-forge", "gurobi"]
platforms = ["linux-64", "osx-arm64", "win-64"]
preview = ["pixi-build"]
[tool.pixi.dependencies]
libnetcdf = ">=4.10"
gurobi = ">=11.0"
glpk = ">=5.0"
coin-or-cbc = ">=2.10.8"
rich = ">=14.0.0"
[tool.pixi.pypi-dependencies]
calliope = { path = ".", editable = true}
[tool.pixi.feature.docs.dependencies]
jsonschema2md = ">=1"
mkdocs = ">=1.5"
mkdocs-click = ">=0.6"
mkdocs-jupyter = ">=0.25"
mkdocs-macros-plugin = ">=1.0"
mkdocs-material = ">=9.5"
mkdocstrings-python = ">=1.7"
plotly = ">=5"
[tool.pixi.feature.dev.dependencies]
identify = ">=2.5.24"
mypy = ">=1.13.0"
pandas-stubs = ">=3.0.3"
pre-commit = ">=3"
pytest = ">=8"
pytest-cov = ">=4"
pytest-order = ">=1"
pytest-xdist = ">=3"
platformdirs = ">=4.11.0"
uv = ">=0.11"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.py313.dependencies]
python = "3.13.*"
[tool.pixi.feature.py314.dependencies]
python = "3.14.*"
[tool.pixi.tasks]
pre-commit-install = { cmd = "pre-commit install > /dev/null", default-environment = "dev" }
test = { cmd = "pytest --no-cov", default-environment = "dev", depends-on = ["pre-commit-install"] }
test-ci = { cmd = "pytest --no-cov -m 'not time_intensive and not needs_gurobi_license'", default-environment = "dev", depends-on = ["pre-commit-install"] }
test-cov = { cmd = "pytest --cov", default-environment = "dev", depends-on = ["pre-commit-install"] }
docs-build = { cmd = "PLOTLY_RENDERER=notebook mkdocs build", default-environment = "docs" }
docs-serve = { cmd = "PLOTLY_RENDERER=notebook mkdocs serve", default-environment = "docs" }
[tool.pixi.environments]
default = { solve-group = "py314" }
dev = { features = ["dev"], solve-group = "py314" }
docs = { features = ["py312", "docs"], solve-group = "py312" }
py312 = { features = ["py312", "dev"], solve-group = "py312" }
py313 = { features = ["py313", "dev"]}
py314 = { features = ["py314", "dev"], solve-group = "py314" }
[tool.pixi.package]
name = { workspace = true }
[tool.pixi.package.build.backend]
channels = ["https://prefix.dev/conda-forge"]
name = "pixi-build-python"
version = "0.*"
[tool.pixi.package.build.config]
ignore-pypi-mapping = false # Enable automatic PyPI-to-conda mapping
[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true