20e04c8b53
CI / linux (map[runner:ubuntu-22.04 target:aarch64]) (push) Failing after 55s
CI / linux (map[runner:ubuntu-22.04 target:armv7]) (push) Failing after 4s
CI / linux (map[runner:ubuntu-22.04 target:ppc64le]) (push) Failing after 4s
CI / linux (map[runner:ubuntu-22.04 target:s390x]) (push) Failing after 4s
CI / linux (map[runner:ubuntu-22.04 target:x86]) (push) Failing after 5s
CI / musllinux (map[runner:ubuntu-22.04 target:aarch64]) (push) Failing after 6s
CI / musllinux (map[runner:ubuntu-22.04 target:armv7]) (push) Failing after 5s
CI / musllinux (map[runner:ubuntu-22.04 target:x86]) (push) Failing after 4s
CI / musllinux (map[runner:ubuntu-22.04 target:x86_64]) (push) Failing after 4s
CI / windows (map[runner:windows-latest target:x64]) (push) Has been cancelled
CI / windows (map[runner:windows-latest target:x86]) (push) Has been cancelled
CI / macos (map[runner:macos-13 target:x86_64]) (push) Has been cancelled
CI / macos (map[runner:macos-14 target:aarch64]) (push) Has been cancelled
CI / Release (push) Has been cancelled
CI / sdist (push) Has been cancelled
CI / linux (map[runner:ubuntu-22.04 target:x86_64]) (push) Failing after 5s
34 lines
941 B
Python
34 lines
941 B
Python
import os
|
|
import sys
|
|
from importlib.metadata import version
|
|
from pathlib import Path
|
|
|
|
os.environ["RUST_BACKTRACE"] = "full"
|
|
os.environ["COLORBT_SHOW_HIDDEN"] = "1"
|
|
|
|
from .kmeans_rs import * # noqa
|
|
|
|
try:
|
|
__version__ = version(Path(__file__).parent.name)
|
|
except (Exception,):
|
|
__version__ = "unknown"
|
|
|
|
try:
|
|
with open(Path(__file__).parent.parent / ".git" / "HEAD") as g:
|
|
head = g.read().split(":")[1].strip()
|
|
with open(Path(__file__).parent.parent / ".git" / head) as h:
|
|
__git_commit_hash__ = h.read().rstrip("\n")
|
|
except (Exception,):
|
|
__git_commit_hash__ = "unknown"
|
|
|
|
|
|
def kmeans_generate_stub():
|
|
if len(sys.argv) > 1:
|
|
path = Path(sys.argv[1]).resolve()
|
|
else:
|
|
path = Path.cwd().resolve()
|
|
if (path / "py" / "kmeans_rs" / "__init__.py").exists():
|
|
generate_stub(str(path)) # noqa
|
|
else:
|
|
raise ModuleNotFoundError(str(path / "py" / "kmeans_rs" / "__init__.py"))
|