qiskit-community / qiskit-aqua

Quantum Algorithms & Applications (**DEPRECATED** since April 2021 - see readme for more info)
https://qiskit.org/aqua
Apache License 2.0
571 stars 377 forks source link

Remove overly aggressive pinning from requirements #1605

Closed mtreinish closed 3 years ago

mtreinish commented 3 years ago

Summary

This commit removes overly aggressive pinning from the requirements list. This pinning makes it extremely difficult in practice to actually install the qiskit-aqua with anything that has any shared dependencies like numpy, scipy, etc because the pinning breaks the dependency solver. I assume this pinning was done defensively to try and prevent code from bit rotting during aqua's deprecation period but it has the opposite effect and ends up preventing things from being installed at all. This commit removes all the version caps from the requirements file to fix this.

Details and comments

woodsp-ibm commented 3 years ago

What do you imagine happening at the end of the deprecation period. We were imagining it would stay there and if you pip installed it, even though its no longer supported or anything, it would pull in versions that we knew it to work with. If you unpin the upper level then its bound to break after a version or two of dependents and then trying to find compatible versions would be a problem., I guess as far as qiskit is concerned, if you install from an old meta, then that would give a set of compatible packages when you find the one that has the Aqua version in it you care about- as to other dependents, well it would be up to someone to try to find dependent versions that worked, if they no longer do.

mtreinish commented 3 years ago

What do you imagine happening at the end of the deprecation period. We were imagining it would stay there and if you pip installed it, even though its no longer supported or anything, it would pull in versions that we knew it to work with. If you unpin the upper level then its bound to break after a version or two of dependents and then trying to find compatible versions would be a problem., I guess as far as qiskit is concerned, if you install from an old meta, then that would give a set of compatible packages when you find the one that has the Aqua version in it you care about- as to other dependents, well it would be up to someone to try to find dependent versions that worked, if they no longer do.

I would say you can try doing that for the final release if you want, I'm not sure it'll actually make it easier to install things after we archive the repo and drop support for it though. But right now while it's deprecated we're still supporting it and also co-installing it as part of the metapackage having these version caps is problematic. I had to open this because I was fielding issues where pip is erroring because of these caps.

woodsp-ibm commented 3 years ago

I will note that is tested here by CI, with other elements. Maybe we are missing IBM Q provider being installed. Certainly we would want whatever is in there to be installable as part of meta. What was failing to resolve out of curiosity - maybe the versions of third party dependents should have allowed bug fix version changes and not be pinned quite as hard on those. If we add this later then in essence we are doing one final release right at the end - maybe after its removed from the meta and hence should install in its own env with whatever the versions are then given it all goes through CI here.

mtreinish commented 3 years ago

It was part of a larger build of a docker image. The requirements file was:

pyscf<1.7.4
jupyter-client!=6.1.13
qiskit[all]~=0.26.0
qiskit-aqua[torch,cvx,pyscf]~=0.9.1
qiskit-ibmq-provider[visualization]~=0.13.1
kaleidoscope~=0.0.10
nbresuse
torchvision
json-logging
ibm-quantum-widgets

but this doesn't capture everything because earlier layers of the build have packages preinstalled (which is where I expect the conflict comes in this case). The specific pip error was around the bug version pinning:

torchvision 0.9.0 has requirement torch==1.8.0, but you have torch 1.8.1+rocm4.0.1.
qiskit-aqua 0.9.1 has requirement numpy<=1.20.1,>=1.17, but you have numpy 1.20.3.
qiskit-aqua 0.9.1 has requirement scikit-learn<=0.24.1,>=0.20.0, but you have scikit-learn 0.24.2.

but the same problems can exist when you have version caps just whenever anything releases qiskit isn't going to be the only package installed. I think doing one final release after it's dropped from the metapackage makes the most sense and then we archive the repo.