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:
111
111
fi
112
112
conda install ${RC_LABEL}khiops-core=$KHIOPS_CORE_VERSION
113
113
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
114
129
- name : Test Khiops Installation Status
115
130
run : kh-status
116
131
- name : Test Khiops Installation Status (Conda-Based Environments)
Original file line number Diff line number Diff line change 22
22
(extension ".khcj")
23
23
- sklearn: Scikit-Learn estimator classes to learn and use Khiops models
24
24
"""
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
-
33
25
from khiops .core .internals .version import KhiopsVersion
34
26
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"
51
28
52
29
53
30
def get_compatible_khiops_version ():
Original file line number Diff line number Diff line change 1
1
{% 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') %}
3
2
package :
4
3
name : {{ name }}
5
4
# The Conda version cannot contain the '-' character, so we eliminate it
6
- version : {{ version | replace('-', '') }}
5
+ version : " 11.0.0.0b.0 "
7
6
8
7
source :
9
8
path : ../../
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ ignore_errors = true
145
145
146
146
[project ]
147
147
name = " khiops"
148
- version = " 11.0.0.0-b.0 "
148
+ dynamic = [ " version " ]
149
149
description = " Python library for the Khiops AutoML suite"
150
150
readme = " README.md"
151
151
license = " BSD-3-Clause-Clear"
@@ -191,6 +191,9 @@ gcs = [
191
191
include = [" khiops" , " khiops.*" ]
192
192
namespaces = false
193
193
194
+ [tool .setuptools .dynamic ]
195
+ version = {attr = " khiops.__version__" }
196
+
194
197
[project .scripts ]
195
198
kh-status = " khiops.tools:kh_status_entry_point"
196
199
kh-samples = " khiops.tools:kh_samples_entry_point"
You can’t perform that action at this time.
0 commit comments