@@ -105,9 +105,13 @@ jobs:
105105 do
106106 # Since Python 3.13, setuptools is not installed automatically anymore
107107 $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
111115 done
112116 - name : Configure Expensive Tests Setting
113117 # Skip expensive tests by default, unless on the `dev`, `dev-v10` or `main` branches
@@ -252,23 +256,22 @@ jobs:
252256 id : setup-python
253257 uses : actions/setup-python@v5
254258 with :
255- python-version : ' 3.11 '
259+ python-version : ' 3.12 '
256260 - name : Install khiops-python dev dependencies
257261 shell : pwsh
258262 run : |
259263 # The following git command is required,
260264 # as the Git repository is in a directory the current user does not own,
261265 # Python versioneer fails to compute the current version correctly otherwise
262266 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
264270
265271 # 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 `
270273 | ForEach-Object {python -m pip install $_.toString()}
271- Remove-Item -r - force khiops.egg-info
274+ Remove-Item -force requires.txt
272275 - name : Setup and Install Test Requirements
273276 run : python -m pip install -r test-requirements.txt
274277 - name : Test Khiops Integration
@@ -344,9 +347,12 @@ jobs:
344347 # as the Git repository is in a directory the current user does not own,
345348 # Python versioneer fails to compute the current version correctly otherwise
346349 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
350356 - name : Setup and Install Test Requirements
351357 run : |
352358 pip install -r test-requirements.txt
0 commit comments