Skip to content
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

Allow disabling of pip installations in setup.py #1128

Closed
ocaisa opened this issue Feb 11, 2021 · 3 comments · Fixed by #1135
Closed

Allow disabling of pip installations in setup.py #1128

ocaisa opened this issue Feb 11, 2021 · 3 comments · Fixed by #1135
Assignees
Labels
enhancement New feature or request

Comments

@ocaisa
Copy link

ocaisa commented Feb 11, 2021

What is the expected behavior?

Currently setup.py is quite aggressive in installing dependencies (see https://github.com/Qiskit/qiskit-aer/blob/master/setup.py#L25). This leads to unexpected behaviour on HPC systems where Qiskit is being installed as an environment module (i.e., self-contained) as it installs these dependencies for the current python, which in our case is in another environment module. This makes our Python installation non-reproducible, and the Qiskit module broken if another Python environment module is used. It should be possible to disable this behaviour since it can have severe unintended consequences.

@ocaisa ocaisa added the enhancement New feature or request label Feb 11, 2021
@vvilpas
Copy link
Contributor

vvilpas commented Feb 12, 2021

Hi @ocaisa! Thanks for letting us know your problem.
I'm not sure if I fully understand the problem, though. Those packages should be installed by setup.py, but scikit-build does that after the C++ code is compiled, and, as we need them before the compilation, we resorted to this alternative approach. If we didn't need them before the C++ compilation, they would be installed as usual by setup.py.
So, can you depict your workflow so we understand better the problem?

@ocaisa
Copy link
Author

ocaisa commented Feb 12, 2021

On our systems we want full knowledge and full control over what is getting installed and where it is being installed. A typical pip command using the tool that we use (EasyBuild) looks like:

pip install --prefix=/path/to/installation/directory  --no-deps  --ignore-installed  --no-build-isolation  .

For a package like qiskit-aer we would bundle together the dependencies required with it (unless they can be provided by another environment module), installing them individually in the required sequence. Your current approach installs additional python packages with indeterminate versions into the prefix where python lives (which is a different location). This results in pip check failing for python:

python -m pip check
conan 1.33.1 requires distro, which is not installed.

and also means our python installation is no longer reproducible.

What we would like is the ability to switch off this dependency installation behaviour, this will trigger a failure in our build system when our sanity checks are run (if a dependency is missing), which is fine since we can solve that ourselves and repeat the process as necessary.

@jhgoebbert
Copy link

jhgoebbert commented Feb 13, 2021

The same problem of using pip inside setup.py can also be found in setup.py of retworkx and qiskit-terra here:
https://github.com/Qiskit/retworkx/blob/master/setup.py#L8
https://github.com/Qiskit/qiskit-terra/blob/master/setup.py#L22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants