Versioning problems when using Nifty in dependencies for other projects
I am currently trying to set up a working setup.py for the HMCF project and have problems making pip install NIFTy on the fly. I am not an expert and therefore the reason for my problem may lie somewhere else, but so far I think the source of it all is that the version is not specified directly in setup.py.
The problem arises, when I specify a dependency link to NIFTy on git in my HMCF setup.py:
setup(name=...
dependency_links=["git+https://gitlab.mpcdf.mpg.de/ift/NIFTy@NIFTy4#egg=nifty4-4.2"],
install_requires=["numpy>=1.10", "nifty4>=4.2", "scipy>=0.17", "h5py>=2.5.0"],
...)
This does not work (I also tried fiddling around with the egg argument, leaving it out, do not specify a version, etc. pp, but the problem remains).
Could not find a version that satisfies the requirement nifty4 (from hmcf==1.0) (from versions: ) No matching distribution found for nifty4 (from hmcf==1.0)
As far as I understand the problem: pip wants to have a version number. In several stack overflow questions and related corners of the internet people state that pip looks for a version in the setup.py file of the dependency. Since NIFTy does not specify the version in an obvious way, pip will not treat NIFTy as a valid package.
Possible Solutions:
- Reinstate NIFTy on python servers as done with NIFTy1
- Specify a version (hard-coded if you want to call it like this) and skip the
__version__
stuff in the setup.py file of NIFTy. I know, this is handy, but I could not find a solution where pip dependencies work while NIFTy is only available via git
I tried the latter solution on a new nifty branch called setup_version_test and it works using
setup(name=...
dependency_links=["git+https://gitlab.mpcdf.mpg.de/ift/NIFTy@setup_version_test#egg=nifty4-4.2"],
...)
in the HMCF setup.py file.
Since we have a number of projects which depend on Nifty and simulate easy installation by issuing a setup.py file (talking about you, starblade), I find it very important that it is actually possible to achieve an on-the-fly installation of Nifty.
Everything in here was done with MPA resources, python 3.5.1 and pip 9.0.1