This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 05dde6a22 chore: delete unused code in scripts (#6084)
05dde6a22 is described below

commit 05dde6a22201b7e20f96260db9192c23d213001c
Author: yihong <[email protected]>
AuthorDate: Thu Apr 24 15:55:04 2025 +0800

    chore: delete unused code in scripts (#6084)
    
    fix: delete unused code in scripts
    
    Signed-off-by: yihong0618 <[email protected]>
---
 scripts/constants.py | 43 -------------------------------------------
 1 file changed, 43 deletions(-)

diff --git a/scripts/constants.py b/scripts/constants.py
index 7986c7ee8..238533c1d 100755
--- a/scripts/constants.py
+++ b/scripts/constants.py
@@ -17,7 +17,6 @@
 # under the License.
 
 from pathlib import Path
-import tomllib
 
 ROOT_DIR = Path(__file__).parent.parent
 
@@ -36,45 +35,3 @@ def list_packages():
 
 
 PACKAGES = list_packages()
-
-# package dependencies is used to maintain the dependencies between packages.
-#
-# All packages are depend on `core` by default, so we should only maintain the 
exceptions in list.
-PACKAGE_DEPENDENCIES = {
-    Path("bindings/go"): "bindings/c",
-    Path("bindings/swift"): "bindings/c",
-    Path("bindings/zig"): "bindings/c",
-}
-
-
-# fetch the package dependence, return `core` if not listed in 
`PACKAGE_DEPENDENCIES`.
-def get_package_dependence(package: Path) -> str:
-    return PACKAGE_DEPENDENCIES.get(package, "core")
-
-
-# input: Path to a Rust package like `core` and `bindings/python`.
-def get_rust_package_version(path):
-    with open(ROOT_DIR / path / "Cargo.toml", "rb") as f:
-        data = tomllib.load(f)
-        version = data["package"]["version"]
-    return version
-
-
-# get the package version by package name.
-#
-# For examples:
-# core: `0.45.0`
-# packages depends on core: `0.1.0`
-def get_package_version(package):
-    if package == "core":
-        return get_rust_package_version("core")
-
-    cargo_toml = ROOT_DIR / package / "Cargo.toml"
-    # cargo_toml exists, we can get the version from Cargo.toml.
-    if cargo_toml.exists():
-        return get_rust_package_version(package)
-
-    # cargo_toml not exists, we should handle case by case ideally.
-    #
-    # However, those packages are not mature enough, it's much easier for us 
to always return `0.0.0` instead.
-    return "0.0.0"

Reply via email to