-
Notifications
You must be signed in to change notification settings - Fork 1
Detect "unhappy" installation states #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
8528be2
to
48d012b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments. The main point of these comments is that the unhappy installation paths are:
- partial installations:
- the Python lib is present, but the binaries are missing;
- hybrid installations:
- the binaries are installed in a Conda env (via the khiops-core package), but the Python lib is installed via Pip;
- the binaries are installed system-wide, but the Python lib is installed in a Conda env (e.g. the khiops-core package has been uninstalled by the user);
- the binaries are installed system-wide and the Python package is installed via Pip, but their versions are not compatible at the major.minor.patch level.
- the binaries and the Python package are installed in a Conda env, but the binaries package got updated, alone, to a future, incompatible version (the Python lib package kept the initial version).
The following are not necessarily "unhappy" IMHO:
- fully-compatible binary + pip installation, run from within a Conda environment (with no binaries or Python library installed in that Conda environment);
- [with less certainty?] fully-compatible full Conda installation inside a Conda env, run from a virtualenv that is activated inside that Conda env (that is, in a shell where the Conda env is also activated), with no Khiops Python library installed in that virtualenv.
Perhaps perform a 3-times check of "happy path":
Any |
27d557c
to
0361146
Compare
After a few attempts it seems that this check is pointless and a big hassle. Pointless because if a wrong python interpreter is used it wouldn't find the correct library (and digging programmatically from the python library for the python executable will lead to the sys.executable). A big hassle because of the OS specificities ('Scripts' folder for Windows instead of 'bin' for example)
Indeed. This check is performed.
Indeed. This check is performed.
|
Wouldn't this accommodate both Windows and Linux:
|
Add warning on Windows system-wide MPI precedence over Conda MPI: https://github.com/conda-forge/msmpi-feedstock/blob/32bc89b1b104dd158a12b161ae2384d5a8a5642c/recipe/activate.bat#L7 |
c8915f8
to
c5ed7d8
Compare
This case is addressed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still a few pending changes (see comments), among which a needed fix.
b91e295
to
b4bb815
Compare
Also, add support for |
6569507
to
4392852
Compare
This "User site" installation is handled now (as an happy path). As a consequence, api docs build does not require any longer a virtual env. Thus, this specific modification in the api-docs.yml was reverted |
4392852
to
fc3b5c0
Compare
441c495
to
2785b62
Compare
khiops/core/internals/runner.py
Outdated
error_list.append(error) | ||
# fetch the 'User site' site-packages | ||
# the path is adapted for each OS (Windows, MacOS, Linux) | ||
user_site_packages = site.getusersitepackages() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/user_site_packages/user_site_packages_dir/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable name was refactored
and thus the CONDA_PREFIX environment variable is undefined | ||
and the path to the `bin` directory inside the conda environment is not in PATH | ||
- 'binary+pip' installs the binaries and the shared libraries system-wide | ||
but will keep the python libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but will keep the Python libraries in the Python system folder or in the Python folder inside the home directory of the user, or in a virtual environment (if one is used)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring modified (for the pip install --user
usage)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, LGTM.
See however a few minor comments (nice to have fixed IMHO).
Also update commit message line:
"- Detect installation incompatibilities in a system-wide pip installation" to
"- Detect installation incompatibilities in a system-wide or user-site pip installation"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add specific user warning if installation type is "unknown" because package metadata is missing (see https://github.com/KhiopsML/khiops-python/pull/402/files#r2284574608 ).
2785b62
to
30682ca
Compare
- Warn when the version tuple (major, minor, patch) of Khiops does not match the Khiops Python library one - Fix the types of the returned objects in `_build_status_message` - Detect installation incompatibilities in an active conda environment - Detect installation incompatibilities in a conda-based environment or a virtual environment - Detect installation incompatibilities in a system-wide pip installation or user-site pip installation
30682ca
to
71ce8b0
Compare
Warning added |
Commit message updated |
_build_status_message
TODO Before Asking for a Review
dev
(ormain
for release PRs)Unreleased
section ofCHANGELOG.md
(no date)index.html