Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,21 @@ jobs:
python -m pip install setuptools
python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" -s "\n" > requires.txt

# Install the Python requirements
# Install the Python requirements outside a python venv
Get-Content .\requires.txt `
| ForEach-Object {python -m pip install $_.toString()}

# Create and activate a python venv
python -m venv khiops-windows-venv
khiops-windows-venv\Scripts\Activate.ps1

# Install the Python requirements inside a venv
# The venv python executable is used here
Get-Content .\requires.txt `
| ForEach-Object {khiops-windows-venv\Scripts\python -m pip install $_.toString()}

Comment on lines +287 to +291
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a ForEach-Object loop simply use python -m pip install --requirements requires.txt

Copy link
Collaborator Author

@tramora tramora Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a existing code, maybe it was to avoid issues manipulating multi-lines file under DOS (\r\n) ?
But OK to simplify this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current command we are sure we get one dependency per line.

# Deactivate the python venv
deactivate
Remove-Item -force requires.txt
- name: Setup and Install Test Requirements
run: python -m pip install -r test-requirements.txt
Expand Down Expand Up @@ -323,6 +335,22 @@ jobs:

# Execute Khiops Coclustering sample (train and deploy model)
Invoke-Expression -Command "$Python -m khiops.samples.samples -i deploy_coclustering -e"

# Install khiops-python in the python venv using the sources
# The venv python executable is used here
Invoke-Expression -Command "khiops-windows-venv\Scripts\python -m pip install ."
# Change directory to avoid using the cloned khiops-python
Invoke-Expression -Command "cd khiops-windows-venv\"

# Print status
# The venv python executable is used here
Invoke-Expression -Command "Scripts\python -c 'import sys; import khiops.core as kh; return_code = kh.get_runner().print_status(); sys.exit(return_code)'"

# The installation status MUST not fail
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a whiteline above to make a paragraph.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

if ($LASTEXITCODE -ne 0) {
Write-Host "::error::Status error: khiops-python installation status check MUST NOT fail"
exit 1
}
check-khiops-integration-on-linux:
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ nbconvert==6.4.4
nbformat==5.3.0
numpydoc>=1.5.0
pandas>=0.25.3
scikit-learn>=0.22.2
scikit-learn>=0.22.2,<=1.7.2
sphinx-copybutton>=0.5.0
12 changes: 9 additions & 3 deletions khiops/core/internals/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,15 @@ def _detect_library_installation_incompatibilities(self, library_root_dir):
if (
platform.system() == "Windows"
and
# Under Windows, python is not in a bin/ folder
# for conda-based installations
str(Path(sys.executable).parents[0]) != base_dir
# Under Windows, there are two cases :
(
# for conda-based installations python is inside 'base_dir'
str(Path(sys.executable).parents[0]) != base_dir
and
# for 'binary+pip' installations (within a virtual env)
# python is inside 'base_dir'/Scripts
str(Path(sys.executable).parents[1]) != base_dir
)
# Under Linux or MacOS a bin/ folder exists
or str(Path(sys.executable).parents[1]) != base_dir
):
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
"pandas>=0.25.3",
"scikit-learn>=0.22.2",
# do not use the latest version, to avoid undesired breaking changes
"scikit-learn>=0.22.2,<=1.7.2",
]

[project.urls]
Homepage = "https://khiops.org"

[project.optional-dependencies]
s3 = [
# do not necessarily use the latest version, to avoid undesired breaking
# changes
# do not use the latest version, to avoid undesired breaking changes
"boto3>=1.17.39,<=1.35.69",
]
gcs = [
Expand Down
Loading