@@ -105,9 +105,13 @@ jobs:
105
105
do
106
106
# Since Python 3.13, setuptools is not installed automatically anymore
107
107
$CONDA install -y -n "$CONDA_ENV" setuptools
108
- $CONDA run --no-capture-output -n "$CONDA_ENV" python setup.py egg_info
109
- $CONDA install -y -n "$CONDA_ENV" `grep -v "^\[" khiops.egg-info/requires.txt`
110
- rm -rf khiops.egg-info
108
+
109
+ # Add homogeneous TOML support (Python >= 3.12 has standard tomllib)
110
+ $CONDA install -y -n "$CONDA_ENV" tomli
111
+ $CONDA run --no-capture-output -n "$CONDA_ENV" python -c \
112
+ "import tomli; from functools import reduce; fp = open('pyproject.toml', 'rb'); p = tomli.load(fp); fp.close(); print(' '.join(reduce(lambda x, y: x + y, list(p['project']['optional-dependencies'].values()), p['project']['dependencies'])))" > requires.txt
113
+ $CONDA install -y -n "$CONDA_ENV" `cat requires.txt`
114
+ rm -f requires.txt
111
115
done
112
116
- name : Configure Expensive Tests Setting
113
117
# Skip expensive tests by default, unless on the `dev`, `dev-v10` or `main` branches
@@ -252,23 +256,22 @@ jobs:
252
256
id : setup-python
253
257
uses : actions/setup-python@v5
254
258
with :
255
- python-version : ' 3.11 '
259
+ python-version : ' 3.12 '
256
260
- name : Install khiops-python dev dependencies
257
261
shell : pwsh
258
262
run : |
259
263
# The following git command is required,
260
264
# as the Git repository is in a directory the current user does not own,
261
265
# Python versioneer fails to compute the current version correctly otherwise
262
266
git config --global --add safe.directory $(Resolve-Path '.' | % {$_.toString()})
263
- python setup.py egg_info
267
+ python -m pip install setuptools
268
+ python -c `
269
+ "import tomllib; from functools import reduce; fp = open('pyproject.toml', 'rb'); p = tomllib.load(fp); fp.close(); print('\n'.join(reduce(lambda x, y: x + y, list(p['project']['optional-dependencies'].values()), p['project']['dependencies'])))" > requires.txt
264
270
265
271
# Install the Python requirements
266
- Get-Content .\khiops.egg-info\requires.txt `
267
- | Select-String -Pattern '^\[' -NotMatch `
268
- | Select-String -Pattern '^$' -NotMatch `
269
- | % {$_.Line} `
272
+ Get-Content .\requires.txt `
270
273
| ForEach-Object {python -m pip install $_.toString()}
271
- Remove-Item -r - force khiops.egg-info
274
+ Remove-Item -force requires.txt
272
275
- name : Setup and Install Test Requirements
273
276
run : python -m pip install -r test-requirements.txt
274
277
- name : Test Khiops Integration
@@ -344,9 +347,12 @@ jobs:
344
347
# as the Git repository is in a directory the current user does not own,
345
348
# Python versioneer fails to compute the current version correctly otherwise
346
349
git config --global --add safe.directory $(realpath .)
347
- python setup.py egg_info
348
- pip install `grep -v "^\[" khiops.egg-info/requires.txt`
349
- rm -rf khiops.egg-info
350
+ # Install tomli for Python < 3.11
351
+ pip install tomli
352
+ python -c \
353
+ "import tomli; from functools import reduce; fp = open('pyproject.toml', 'rb'); p = tomli.load(fp); fp.close(); print(' '.join(reduce(lambda x, y: x + y, list(p['project']['optional-dependencies'].values()), p['project']['dependencies'])))" > requires.txt
354
+ pip install `cat requires.txt`
355
+ rm -f requires.txt
350
356
- name : Setup and Install Test Requirements
351
357
run : |
352
358
pip install -r test-requirements.txt
0 commit comments