-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
159 lines (138 loc) · 4.91 KB
/
pyproject.toml
File metadata and controls
159 lines (138 loc) · 4.91 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
[build-system]
requires = ["uv_build>=0.9.15,<0.10.0"]
build-backend = "uv_build"
[project]
name = "cognite-databricks"
version = "0.0.0"
description = "Helper SDK for Databricks UDTF registration and Unity Catalog integration"
readme = "README.md"
requires-python = ">=3.10,<4.0"
license = "Apache-2.0"
authors = [
{name = "Cognite", email = "support@cognite.com"}
]
keywords = ["cognite", "cdf", "databricks", "udtf", "unity-catalog", "secret-manager"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
# Note: For local builds, use >=0.0.0 to allow 0.0.0 wheels. For releases, update to >=0.2.2
"cognite-pygen-spark>=0.2.2", # Use >=0.0.0 for local builds, >=0.2.2 for releases
"cognite-sdk>=7.90.1",
"databricks-sdk>=0.20.0",
"toml>=0.10.2", # Required by cognite-pygen for load_cognite_client_from_toml
"pyasn1>=0.6.2", # Security fix for CVE-2026-23490 (memory exhaustion vulnerability)
# PySpark is provided by Databricks runtime - do not include as dependency
# For local development, install with: pip install cognite-databricks[local]
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-cov>=6.0.0",
"pytest-mock>=3.10.0",
"pytest-rerunfailures>=14.0",
"pytest-icdiff>=0.8",
"black>=24.4.2",
"ruff==0.6.2", # Match pre-commit hook version (ruff-pre-commit v0.6.2)
"mypy>=1.5.0",
"pre-commit>=4.0.0",
"pandas>=1.5.3", # Required by cognite-pygen._build (via cognite-pygen-spark)
"pydantic>=2.0.0", # Required for mypy pydantic plugin
"typer>=0.9.0", # For dev.py CLI
"marko>=2.1.0,<3.0.0", # For parsing commit messages
"packaging>=21.3", # For version parsing
"twine>=6.0.0", # For PyPI upload
]
local = [
"pyspark>=3.0.0", # Only for local development/testing outside Databricks
]
[project.urls]
Homepage = "https://github.com/cognitedata/cognite-databricks"
Documentation = "https://cognite-cognite-databricks.readthedocs-hosted.com/en/latest/"
Repository = "https://github.com/cognitedata/cognite-databricks"
Issues = "https://github.com/cognitedata/cognite-databricks/issues"
[tool.uv.build-backend]
module-name = "cognite.databricks"
module-root = ""
[tool.black]
line-length = 120
target_version = ['py310']
include = '\.py$'
[tool.ruff]
# See https://beta.ruff.rs/docs/rules for an overview of ruff rules
line-length = 120
target-version = "py310"
exclude = ["examples", "scripts"]
fix = true
[tool.ruff.lint]
select = ["E","W","F","I","RUF","TID","UP", "B", "FLY", "PTH", "ERA"]
fixable = ["E","W","F","I","RUF","TID","UP", "B", "FLY", "PTH", "ERA"]
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
# Typer do function calls when setting up the CLI.
"B008", # Do not perform function call {name} in argument defaults
# This is done when setting the pygen configs, and useful for getting pretty docs.
# In that case, this is also safe as the function calls produced immutable data.
"RUF009", #Do not perform function call in defaults
"W293", # Blank line contains whitespace (primarily in docstrings)
]
[tool.ruff.lint.isort]
known-first-party = []
known-third-party = ["cognite.client"]
[tool.mypy]
explicit_package_bases = true
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
plugins = ["pydantic.mypy"]
ignore_missing_imports = false # Set to false by default, use overrides for specific modules
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
# Ignore missing imports for third-party libraries without type stubs
[[tool.mypy.overrides]]
module = "pyspark.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "databricks.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "cognite.client.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "cognite.pygen_spark.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pytest"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pytest.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "cognite.databricks.udtf_registry"
disable_error_code = ["no-any-return"]
[[tool.mypy.overrides]]
module = "cognite.databricks.secret_manager"
disable_error_code = ["no-any-return"]
[tool.pytest.ini_options]
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources",
]
addopts = "--doctest-modules"
markers = [
"integration: Integration tests requiring external services.",
"slow: Slow running tests.",
]
pythonpath = ["."]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]