Search code examples
pythonpiprequirements.txtfb-hydra

Pipreqs generate incorrect requiremnets for Hydra


I'm using pipreqs for generating requirements.txt. I started using hydra package (see https://hydra.cc/ or hydra-core package on PyPI). So I would like pipreqs to add hydra-core dependency automatically when I run.

But, when I checked output of pipreqs (directly in requirements.txt when running pipreqs --force or from console output with pipreqs --print) there is Hydra==2.5. But it's incorrect package (leading to Hydra which is package with a high performance bloom filter). I would expect to see hydra-core==1.0.6 which is the right version of my hydra (hydra-core to be correct) package.

Is there anything what should I do differently? Or is there any issue with pipreqs?


  • Python 3.8.6
  • pipreqs version: 0.4.10

Solution

  • Unfortunately the Hydra package, first released at 2010 - predated the Hydra Framework, so I was not able to use name hydra as the pypi package name (hence hydra-core). I even reached out to the owner of that project, politely asking if he can let go of that name. I was not surprised when he declined :).

    Installing hydra instead of hydra-core is pretty common mistake for people getting started with Hydra.

    Looking at that project, they do have a mechanism to help indicate what package to use when seeing an import, which might be helpful. See this PR for example. You may want to open a pull request to add hydra-core to their mapping. Given that hydra-core is much more popular than the other hydra, I think they will be okay with it.