-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
133 lines (120 loc) · 4.17 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
[tool.poetry]
name = "cognite-power-ops"
version = "0.101.1"
description = "SDK for power markets operations on Cognite Data Fusion"
readme = "README.md"
authors = ["Cognite <support@cognite.com>"]
license = "Apache 2.0"
documentation = "https://cognite-power-ops-sdk.readthedocs-hosted.com/en/latest/"
homepage = "https://cognite-power-ops-sdk.readthedocs-hosted.com/en/latest/"
repository = "https://github.com/cognitedata/power-ops-sdk"
packages = [{include = "cognite", from = "."}]
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py310"
# TODO: remove scripts from exclude if problems are fixed
exclude = ["scripts", "cognite/powerops/client/_generated", "docs"]
fix = true
[tool.ruff.format]
# Matches black formatting style
quote-style = "double"
indent-style = "space"
line-ending = "auto"
docstring-code-format = true
[tool.ruff.lint]
ignore = [
# This is causing issues for pydantic which does not support use of X | Y for type annotations before 3.10
"UP007", # Use X | Y for type annotations
]
# Other rules that could be enabled if we fix existing issues: "C90", "D", "PL", "TRY", "DOC", flake8 rules
select = ["F", "E", "W", "I", "N", "UP", "B", "TID", "PTH", "ERA", "RUF", "PD", "PGH", "FLY", "NPY", "PERF", "FURB"]
fixable = ["ALL"]
[tool.ruff.lint.isort]
known-third-party = ["cognite.client"]
[tool.mypy]
python_version = "3.10"
warn_unused_configs = true
disallow_subclassing_any = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_any_generics = false # TODO: Enable this when dict type hints are fixed
disallow_untyped_calls = false # TODO: Enable this when retry from powerops sdk is typed
disallow_untyped_decorators = false # TODO: Enable this when retry from powerops sdk is typed
warn_redundant_casts = true
warn_unused_ignores = true
strict_equality = true
extra_checks = true
explicit_package_bases = true
exclude = [
# The plan is to gradually add mypy to the code base. As of 18. July 2023,
# the following packages are not type checked:
"^cognite/powerops/client/",
]
allow_redefinition = true
plugins = ["pydantic.mypy"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = false
[tool.poetry.dependencies]
python = ">=3.10,<3.13"
typer = {version="^0.12.0", extras=["rich"]}
PyYAML = "^6.0"
cognite-sdk = {version = ">=7.43", extras = ["pandas"]}
pydantic = "^2.0"
pydantic-settings = "^2.0"
loguru = "^0.7.0"
deepdiff = "^6.3.0"
matplotlib = "^3.7.1"
dacite = "^1.8.1"
python-dotenv = "^1.0.0"
arrow = "^1.2.0"
typing_extensions = ">= 4"
tomli = {version = "^2.0.1", python = "<3.11"}
StrEnum = {version = "^0.4.15", python = "<3.11"}
tomli-w = "^1.0.0"
tabulate = "^0.9"
cognite-pygen = "^0.99.24"
toml = ">=0.10"
mkdocs = {version="*", optional=true}
mkdocs-jupyter = {version="*", optional=true}
mkdocs-material = {version="*", optional=true}
mkdocs-material-extensions = {version="*", optional=true}
mkdocs-git-revision-date-localized-plugin = {version="*", optional=true}
mkdocs-git-authors-plugin = {version="*", optional=true}
mkdocs-gitbook = {version="*", optional=true}
mkdocs-glightbox = {version="*", optional=true}
pymdown-extensions = {version="*", optional=true}
mkdocstrings = {version="*", optional=true, extras=["python"]}
cachelib = "^0.13.0"
[tool.poetry.extras]
docs = ["mkdocs", "mkdocs-jupyter", "mkdocs-material", "mkdocs-material-extensions", "mkdocs-git-revision-date-localized-plugin",
"mkdocs-git-authors-plugin", "mkdocs-gitbook", "mkdocs-glightbox", "pymdown-extensions", "mkdocstrings"]
[tool.poetry.scripts]
powerops = "cognite.powerops.cli:main"
[tool.poetry.group.dev.dependencies]
cognite-toolkit = "^0.3.0"
pre-commit = "^3.2.2"
profilehooks = "^1.12.0"
pytest-mock = "^3.10.0"
pytest-regressions = "^2.4.2"
ipykernel="6.24.0"
jupyter = "^1.0.0"
mypy = "^1.4"
pandas-stubs = "^2"
types-PyYAML = "^6"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"
twine = "^5.0.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
addopts = "--doctest-modules --ignore=customers/ --ignore=examples/ --ignore=playground/ --ignore=cognite/powerops/client"
testpaths = [
"tests",
"cognite",
]
log_cli = true