MCPcopy
hub / github.com/dlt-hub/dlt / dlt_version_to_plugin_version

Function dlt_version_to_plugin_version

tools/check_hub_extras.py:55–71  ·  view source on GitHub ↗

Convert dlt version to expected plugin version. dlt 1.20.0 -> plugin 0.20.0 dlt 1.19.0a5 -> plugin 0.19.0a5 The major version is set to 0, and minor.patch are kept from dlt.

(dlt_ver: str)

Source from the content-addressed store, hash-verified

53
54
55def dlt_version_to_plugin_version(dlt_ver: str) -> str:
56 """Convert dlt version to expected plugin version.
57
58 dlt 1.20.0 -> plugin 0.20.0
59 dlt 1.19.0a5 -> plugin 0.19.0a5
60
61 The major version is set to 0, and minor.patch are kept from dlt.
62 """
63 v = Version(dlt_ver)
64 # Build version string with major=0
65 parts = [f"0.{v.minor}.{v.micro}"]
66 if v.pre:
67 # Pre-release like a5, b1, rc2
68 parts.append(f"{v.pre[0]}{v.pre[1]}")
69 if v.dev is not None:
70 parts.append(f".dev{v.dev}")
71 return "".join(parts)
72
73
74def check_hub_extras() -> int:

Callers 1

check_hub_extrasFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected