File tree Expand file tree Collapse file tree 4 files changed +21
-27
lines changed
Expand file tree Collapse file tree 4 files changed +21
-27
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,21 @@ jobs:
111111 fi
112112 conda install ${RC_LABEL}khiops-core=$KHIOPS_CORE_VERSION
113113 conda install --channel ./khiops-conda/ khiops
114+ - name : Install JQ test dependency (Linux / MacOS)
115+ if : runner.os != 'Windows'
116+ run : conda install jq
117+ - name : Test Conda / Python Package Version Coherence
118+ run : |
119+ PACKAGE_VERSION=$(python -c "import khiops; print(khiops.__version__)")
120+ CONDA_VERSION=$(conda list ^khiops$ --json | jq ".[].version")
121+
122+ # Fail if CONDA_VERSION is not identical to $PACKAGE_VERSION
123+ echo $CONDA_VERSION | grep -wq $PACKAGE_VERSION
124+ if [[ $? -ne 0 ]]
125+ then
126+ echo "::error::Conda package version $CONDA_VERSION does not match Python package version $PYTHON_VERSION"
127+ false
128+ fi
114129 - name : Test Khiops Installation Status
115130 run : kh-status
116131 - name : Test Khiops Installation Status (Conda-Based Environments)
Original file line number Diff line number Diff line change 2222 (extension ".khcj")
2323- sklearn: Scikit-Learn estimator classes to learn and use Khiops models
2424"""
25- import importlib .metadata
26- import os
27- import sys
28- import warnings
29- from copy import copy
30- from importlib .metadata import PackageNotFoundError
31- from pathlib import Path
32-
3325from khiops .core .internals .version import KhiopsVersion
3426
35- try :
36- # Package is installed
37- __version__ = importlib .metadata .version (__name__ )
38- except PackageNotFoundError :
39- # Package is not installed, hence parse the pyproject.toml file
40- try :
41- # Python >= 3.11: use the standard-library tomllib module
42- import tomllib as tomli
43- except ModuleNotFoundError :
44- # Python < 3.11: use the Pip-vendored tomli module
45- from pip ._vendor import tomli
46- with open ("pyproject.toml" , "rb" ) as metadata_file :
47- metadata = tomli .load (metadata_file )
48-
49- # Strip "-" from pre-release versions to match installed package metadata
50- __version__ = metadata .get ("project" ).get ("version" ).replace ("-" , "" )
27+ __version__ = "11.0.0.0b.0"
5128
5229
5330def get_compatible_khiops_version ():
Original file line number Diff line number Diff line change 11{% set name = load_file_data('../../pyproject.toml', from_recipe_dir=True).get('project').get('name') %}
2- {% set version = load_file_data('../../pyproject.toml', from_recipe_dir=True).get('project').get('version') %}
32package :
43 name : {{ name }}
54 # The Conda version cannot contain the '-' character, so we eliminate it
6- version : {{ version | replace('-', '') }}
5+ version : " 11.0.0.0b.0 "
76
87source :
98 path : ../../
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ ignore_errors = true
145145
146146[project ]
147147name = " khiops"
148- version = " 11.0.0.0-b.0 "
148+ dynamic = [ " version " ]
149149description = " Python library for the Khiops AutoML suite"
150150readme = " README.md"
151151license = " BSD-3-Clause-Clear"
@@ -191,6 +191,9 @@ gcs = [
191191include = [" khiops" , " khiops.*" ]
192192namespaces = false
193193
194+ [tool .setuptools .dynamic ]
195+ version = {attr = " khiops.__version__" }
196+
194197[project .scripts ]
195198kh-status = " khiops.tools:kh_status_entry_point"
196199kh-samples = " khiops.tools:kh_samples_entry_point"
You can’t perform that action at this time.
0 commit comments