Skip to content

Conversation

@tramora
Copy link
Collaborator

@tramora tramora commented Dec 9, 2025

  • python sys.base_prefix differs from sys.prefix in conda-based installation or pip installation within a virtual env

TODO Before Asking for a Review

  • Rebase your branch to the latest version of dev (or main for release PRs)
  • Make sure all CI workflows are green
  • When adding a public feature/fix: Update the Unreleased section of CHANGELOG.md (no date)
  • Self-Review: Review "Files Changed" tab and fix any problems you find
  • API Docs (only if there are changes in docstrings, rst files or samples):
    • Check the docs build without warning: see the log of the API Docs workflow
    • Check that your changes render well in HTML: download the API Docs artifact and open index.html
    • If there are any problems it is faster to iterate by building locally the API Docs

…unhappy installation paths under Windows

- python sys.base_prefix differs from sys.prefix in conda-based installation or pip installation within a virtual env
pyproject.toml Outdated
dependencies = [
"pandas>=0.25.3",
"scikit-learn>=0.22.2",
# do not necessarily use the latest version, to avoid undesired breaking
Copy link
Member

Choose a reason for hiding this comment

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

Remove necessarily. Fit to one line.

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: improper setup, as expected: khiops-python has been cloned, not installed from a package"
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Remove this whitespace.

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

Comment on lines +287 to +291
# 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()}
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.

# 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

Comment on lines 339 to 342
# Install khiops-python in the python venv using the sources
Invoke-Expression -Command "khiops-windows-venv\Scripts\Activate.ps1"
# The venv python executable is used here
Invoke-Expression -Command "khiops-windows-venv\Scripts\python -m pip install ."
Copy link
Member

Choose a reason for hiding this comment

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

If you are using directly the venv python path I don't think it is necessary to activate it. So I'd remove the first command.

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

@tramora tramora force-pushed the fix-unhappy-paths-detection-windows branch from 8281994 to 4dc2b18 Compare December 11, 2025 11:09
@tramora tramora force-pushed the fix-unhappy-paths-detection-windows branch from 4dc2b18 to c240e99 Compare December 11, 2025 11:21
@tramora tramora merged commit 6e5bcb1 into dev Dec 11, 2025
69 of 70 checks passed
@tramora tramora deleted the fix-unhappy-paths-detection-windows branch December 11, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants