forked from calliope-project/calliope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
141 lines (119 loc) · 4.44 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
136
137
138
139
140
141
[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"
# TODO: add testpath once notebooks are fixed: "doc/_static/notebooks"
testpaths = ["tests"]
# to mark a test, decorate it with `@pytest.mark.[marker-name]`
markers = ["serial", "time_intensive"]
filterwarnings = [
# https://github.com/pytest-dev/pytest-xdist/issues/825
"ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning",
"ignore:.*`group_share` constraints will be removed in v0.7.0.*:FutureWarning:",
"ignore:.*Plotting will no longer be available as a method.*:FutureWarning:",
"ignore:.*There will be no default cost class for the objective function in v0.7.0.*:FutureWarning:",
"ignore:.*`charge_rate` is renamed to `energy_cap_per_storage_cap_max` and will be removed in v0.7.0.*:FutureWarning:",
"ignore:.*Deprecated, pass a TempConstr or use Model.addLConstr.*:DeprecationWarning:pyomo",
"ignore:.*distutils Version classes are deprecated.*:DeprecationWarning:",
"ignore:.*`np.float` is a deprecated alias.*:DeprecationWarning:",
]
[tool.coverage.run]
branch = true
source = ["src/"]
[tool.coverage.html]
directory = "reports/coverage"
[tool.coverage.xml]
output = "reports/coverage/coverage.xml"
[tool.black]
line-length = 88
skip_magic_trailing_comma = true
target-version = ['py310', 'py311', 'py312']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.github
| \.mypy_cache
| \.pytest_cache
| \.vscode
| _build
| build
| dist
| .*\.egg-info
# directories without python source files
| requirements
)/
'''
[tool.ruff]
line-length = 88
select = ["E", "F", "I", "Q", "W"]
# line too long; Black will handle these
ignore = ["E501"]
[tool.ruff.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.per-file-ignores]
"__init__.py" = ["E402", "F401"]
"*.ipynb" = ["E402"]
[tool.ruff.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.pycodestyle]
max-doc-length = 200
ignore-overlong-task-comments = true
[tool.codespell]
skip = 'tests/**/*,**/*.ipynb,doc/**/*'
count = ''
quiet-level = 3
[tool.setuptools.packages.find]
where = ["src"]
include = ["calliope*"]
[tool.setuptools.package-data]
calliope = ["config/*", "math/*", "example_models/**/*"]
[tool.setuptools]
license-files = ["LICENSE", "CITATION"]
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "calliope"
authors = [
{ name = "Calliope contributors listed in AUTHORS", email = "[email protected]" },
]
maintainers = [
{ name = "Stefan Pfenninger", email = "[email protected]" },
{ name = "Bryn Pickering", email = "[email protected]" },
]
description = "A multi-scale energy systems modelling framework."
readme = "README.md"
requires-python = ">=3.9"
keywords = ["energy systems", "optimisation", "mathematical programming"]
license = { text = "Apache 2.0" }
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", "optional-dependencies"]
[tool.setuptools.dynamic]
dependencies = { file = ["requirements/base.txt"] }
version = { attr = "calliope._version.__version__" }
[project.scripts]
calliope = "calliope.cli:cli"
[tool.setuptools.dynamic.optional-dependencies]
dev = { file = ["requirements/dev.txt"] }
docs = { file = ["requirements/docs.txt"] }
[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"