Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/scripts/envgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,17 @@ def _filtered(pkgs, env_name=None):
def dbconnect_pin(pkgs):
"""Return the dev-group databricks-connect requirement, or None.

Serverless lists a concrete databricks-connect (e.g. '17.3.1'), but a serverless
environment version tracks a whole major line, not a single point release. So the
pin is by bare major — ``~=MAJOR.0`` (e.g. '17.3.1' -> ``databricks-connect~=17.0``,
resolving ``>=17.0, <18.0``) — to pick up the latest release within that major.
Serverless lists a concrete databricks-connect (e.g. '18.0.9'). The pin is by
MAJOR.MINOR — ``~=MAJOR.MINOR.0`` (e.g. '18.0.9' -> ``databricks-connect~=18.0.0``,
resolving ``>=18.0.0, <18.1``) — matching the minor series the constraint list was
generated from. A broader major-only pin (``~=18.0``) allows newer minor releases
whose bundled pyspark protobuf stubs may be incompatible with the pinned runtime
libraries (protobuf, grpcio) in the constraint list.
"""
v = pkgs.get("databricks-connect")
if not v:
return None
return f"databricks-connect~={v.split('.')[0]}.0"
return f"databricks-connect~={'.'.join(v.split('.')[:2])}.0"


def build_pyproject(pkgs, env_name, python_version, dbconnect=None):
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/test_envgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ def test_constraints(self):
class DbconnectPinTest(unittest.TestCase):
def test_strips_local_version_segment(self):
# databricks-connect is installed from the dev group as a plain PyPI release;
# the pin is normalized to ~=MAJOR.0, so a local segment in the release-notes
# the pin is normalized to ~=MAJOR.MINOR.0, so a local segment in the release-notes
# version is discarded and never lands in an artifact. dbconnect_pin reads raw
# pkgs (not _filtered), so this guards that the normalization does the stripping.
self.assertEqual(
dbconnect_pin({"databricks-connect": "17.3.1+db1"}),
"databricks-connect~=17.0",
"databricks-connect~=17.3.0",
)

def test_none_when_absent(self):
Expand Down
2 changes: 1 addition & 1 deletion python/serverless/serverless-v1/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = "==3.10.*"

[dependency-groups]
dev = [
"databricks-connect~=14.0",
"databricks-connect~=14.3.0",
]

[tool.uv]
Expand Down
2 changes: 1 addition & 1 deletion python/serverless/serverless-v2/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = "==3.11.*"

[dependency-groups]
dev = [
"databricks-connect~=15.0",
"databricks-connect~=15.4.0",
]

[tool.uv]
Expand Down
2 changes: 1 addition & 1 deletion python/serverless/serverless-v3/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = "==3.12.*"

[dependency-groups]
dev = [
"databricks-connect~=16.0",
"databricks-connect~=16.4.0",
]

[tool.uv]
Expand Down
2 changes: 1 addition & 1 deletion python/serverless/serverless-v4/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = "==3.12.*"

[dependency-groups]
dev = [
"databricks-connect~=17.0",
"databricks-connect~=17.3.0",
]

[tool.uv]
Expand Down
2 changes: 1 addition & 1 deletion python/serverless/serverless-v5-ml/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = "==3.12.*"

[dependency-groups]
dev = [
"databricks-connect~=18.0",
"databricks-connect~=18.0.0",
]

[tool.uv]
Expand Down
2 changes: 1 addition & 1 deletion python/serverless/serverless-v5/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = "==3.12.*"

[dependency-groups]
dev = [
"databricks-connect~=18.0",
"databricks-connect~=18.0.0",
]

[tool.uv]
Expand Down