-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
170 lines (147 loc) · 5.32 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
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
[tool.poetry]
name = "libecalc"
# DO_NOT_EDIT: Version number automatically changed in CICD
version = "9.4.0" # x-release-please-version
# END_DO_NOT_EDIT
description = "eCalc™ is a software tool for calculation of energy demand and greenhouse gas (GHG) emissions from oil and gas production and processing."
keywords = ["energy", "emission", "scientific", "engineering"]
authors = ["eCalc Team <[email protected]>"]
license = "LGPL-3.0-only"
readme = "README.md"
homepage = "https://github.com/equinor/ecalc"
repository = "https://github.com/equinor/ecalc"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Natural Language :: English",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
]
packages = [
{ include = "ecalc_cli", from = "src" },
{ include = "ecalc_neqsim_wrapper", from = "src" },
{ include = "libecalc", from = "src" },
]
[tool.poetry.scripts]
ecalc = 'ecalc_cli.main:main'
[tool.poetry.dependencies]
python = ">=3.11,<3.14"
pydantic = "<3"
PyYAML = "^6"
numpy = "<3"
pandas = "~2"
scipy = ">= 1.14, < 1.15"
"ruamel.yaml" = "^0.18"
Shapely = "^2"
networkx = "^3.2"
orjson = "^3.8"
py4j = "^0.10"
rich = "^13.7.1" # also used for typer as optional dependency
jupyter = { version = "^1.0.0", optional = true }
matplotlib = { version = "^3.8", optional = true }
typer = "^0"
[tool.poetry.group.dev.dependencies]
pytest-snapshot = "^0.9"
pytest = "^7.3"
coverage = { version = "^7.2.5", extras = ["toml"] }
pdoc = "^14.5.1"
nbconvert = "^7.4.0"
pytest-xdist = "^3.3.0"
inline-snapshot = "^0.12.1"
[tool.poetry.extras]
notebooks = ["jupyter", "matplotlib"]
[build-system]
requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"
# plugins, plugin config etc
[tool.pytest.ini_options]
testpaths = [
"tests",
]
addopts = "--import-mode=importlib"
filterwarnings = [
"error::DeprecationWarning", # Treat all DeprecationWarnings as errors and ignore explicitly below if needed
"ignore:Avoid using the dto.*:DeprecationWarning", # Ignore internal deprecation warnings
"always:Arrays of 2-dimensional*", # treat numpy 2.0 deprecation on 2-dimensional matrix as warning (not error)
]
markers = [
"e2e: e2e tests.",
"integtest: integration test",
"slow: slow tests, often snapshot, but not necessarily. > 1 second.",
"snapshot: snapshot tests, notoriously slow, but not necessarily.",
"inlinesnapshot: inline snapshot tests, often used to test error messages",
"dockersnapshot: tests that need x86 architecture for snapshot creation, so we make them in a container",
]
[tool.mypy]
ignore_missing_imports = true
warn_return_any = false
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
strict_equality = true
strict_concatenate = true
check_untyped_defs = true
no_implicit_reexport = true
warn_no_return = false
disable_error_code = ["call-overload", "union-attr", "valid-type", "return-value", "attr-defined", "assignment"]
namespace_packages = true
explicit_package_bases = true
plugins = ['pydantic.mypy', 'numpy.typing.mypy_plugin']
[tool.coverage.run]
omit = ["^./__init__.py", "^api/.*"]
[tool.ruff]
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
target-version = "py311"
line-length = 120
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # Python upgrade, automatically upgrade syntax for newer versions of the language.
"S", # flake8-bandit
]
# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]
ignore = [
"E501", # line too long, handled by formatter
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"B012", # TODO: Consider mitigation: `return` inside `finally` blocks cause exceptions to be silenced
"B023", # FIXME: Potentially bugs in compressor code! Function definition does not bind loop variable. tracked by issue 3975
"B905", # strict= parameter in zip() was added in python 3.10
"UP006", # Avoid switching type annotations to 3.10
"UP007", # Avoid switching type annotations to 3.10
"S101", # Allow use of assert (especially for tests)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]
[tool.interrogate] # Monitor doc-string coverage
fail-under = 25 # Fail CI if the doc-string coverage falls below this level TODO: Set to 100%
ignore-init-method = true
ignore-init-module = false
ignore-magic = false
ignore-semiprivate = false
ignore-private = true
ignore-property-decorators = true
ignore-module = true
ignore-nested-functions = true
ignore-nested-classes = true
ignore-setters = false
quiet = false
[tool.codespell]
skip = '*.ts,*.lock,*package-lock.json'
ignore-words-list = "installationa, mke, ellipsis" # 'InstallationA' and 'Missing key error', ellipsis (...)