Skip to content

Commit d907ef5

Browse files
committed
Drop versioneer; hard-code the version, as for the Khiops binaries
1 parent e6b11ab commit d907ef5

File tree

6 files changed

+15
-3088
lines changed

6 files changed

+15
-3088
lines changed

khiops/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,25 @@
2222
(extension ".khcj")
2323
- sklearn: Scikit-Learn estimator classes to learn and use Khiops models
2424
"""
25-
import importlib
26-
import importlib.util
2725
import os
2826
import sys
2927
import warnings
3028
from copy import copy
3129
from pathlib import Path
3230

33-
from khiops._version import get_versions
3431
from khiops.core.internals.version import KhiopsVersion
3532

36-
__version__ = get_versions()["version"]
37-
del get_versions
33+
try:
34+
# Python >= 3.11: use the standard-library tomllib module
35+
import tomllib as tomli
36+
except ModuleNotFoundError:
37+
# Python < 3.11: use the Pip-vendored tomli module
38+
from pip._vendor import tomli
39+
with open("pyproject.toml", "rb") as metadata_file:
40+
metadata = tomli.load(metadata_file)
41+
42+
# Strip "-" from pre-release versions to match installed package metadata
43+
__version__ = metadata.get("project").get("version").replace("-", "")
3844

3945

4046
def get_compatible_khiops_version():

0 commit comments

Comments
 (0)