sorgerlab / indra

INDRA (Integrated Network and Dynamical Reasoning Assembler) is an automated model assembly system interfacing with NLP systems and databases to collect knowledge, and through a process of assembly, produce causal graphs and dynamical models.
http://indra.bio
BSD 2-Clause "Simplified" License
173 stars 65 forks source link

Pip backtracking during install #1369

Closed bgyori closed 2 years ago

bgyori commented 2 years ago

Recent versions of pip attempt to resolve dependency conflicts by backtracking in version history to find versions of dependencies that are compatible. It appears a simple pip install indra is working fine but when trying to do pip install indra[all] to install all extra dependencies, we get into a seemingly endless backtracking situation like:

INFO: pip is looking at multiple versions of bioregistry to determine which version is compatible with other requirements. This could take a while.
Collecting bioregistry>=0.2.3
  Downloading bioregistry-0.4.58-py3-none-any.whl (3.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 8.6 MB/s eta 0:00:00
  Downloading bioregistry-0.4.57-py3-none-any.whl (3.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 11.2 MB/s eta 0:00:00
  Downloading bioregistry-0.4.56-py3-none-any.whl (3.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 10.0 MB/s eta 0:00:00
...
  Downloading bioregistry-0.4.23-py3-none-any.whl (2.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 4.5 MB/s eta 0:00:00
  Downloading bioregistry-0.4.22-py3-none-any.whl (2.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 2.7 MB/s eta 0:00:00
  Downloading bioregistry-0.4.21-py3-none-any.whl (2.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 1.7 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of backcall to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of appnope to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of appdirs to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of werkzeug to determine which version is compatible with other requirements. This could take a while.

This is currently causing Github Actions runs to fail but I could also reproduce it locally in a clean virtualenv. Though the behavior is slightly different with pip 21.x vs 22.x, both end up endlessly backtracking.

bgyori commented 2 years ago

I suspect the issue is with the pybel>=0.15.0,<0.16.0 dependency which in turn pulls in pyobo and bioregistry. However, in itself, pip install pybel works in a clean virtualenv.

cthoyt commented 2 years ago

Do you think making a new release of PyBEL with no version constraint on the bioregistry would solve this?

I don't think that there's anything particularly wrong with this version pin and this might be a bug in pip's resolver, though

update: I looked into this then made a new release of PyBEL (v0.15.5) that did the following:

  1. Unpin the bioregistry version in the PyBEL requirements
  2. Move the dependency on pyobo and protmapper into extras, since these aren't part of the main functionality and not anything that INDRA uses. It turns out that pyobo also has a bioregistry version pin, and maybe that's what got pip upset (though they shouldn't have actually conflicted)
bgyori commented 2 years ago

Looks like that worked!