qiboteam / qibojit

Accelerating Qibo simulation with just-in-time compilation.
https://qibo.science
Apache License 2.0
15 stars 3 forks source link

`cupy` gets removed while installing `qibojit` #191

Closed BrunoLiegiBastonLiegi closed 2 months ago

BrunoLiegiBastonLiegi commented 2 months ago

I am not sure whether this is expected to happen, but I noticed that cupy gets removed when you install qibojit with poetry:

$ poetry install
Installing dependencies from lock file

Package operations: 0 installs, 5 updates, 2 removals

  - Removing cupy-cuda12x (13.3.0)
  - Removing fastrlock (0.8.2)
  - Updating antlr4-python3-runtime (4.13.1 -> 4.13.2)
  - Updating tqdm (4.66.4 -> 4.66.5)
  - Updating setuptools (70.3.0 -> 75.1.0)
  - Updating sympy (1.13.1 -> 1.13.3)
  - Updating qibo (0.2.10 4a24b6c -> 0.2.12 4a24b6c)

Installing the current project: qibojit (0.1.6)

installing with pip install -e . doesn't seem to affect cupy instead.

alecandido commented 2 months ago

Long story short: you should use poetry install --all-extras.

Slightly longer explanation: Poetry manages your whole environment, keeping the dependencies in the lock file, and removing those that are not needed any longer, while pip is just adding (or updating) those that are resolved for the specific command issued. So, pip is installing on top (the dependencies that are communicated by the build backend, that is still Poetry, but not the env manager), while Poetry is taking into account the removal, since considered cupy as not needed any longer, since it's an optional dependency, and no extra including it is specified in the command.

If you confirm the explanation, feel free to close the issue.