-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: use requirements.txt from dependencies #493
Comments
@casperdcl do you have any suggestions on how this is usually handled? |
Er... why would you pull in the deps requirements? The whole point of SIRF need only define its direct dependencies. |
Or do you mean syncing/removing https://github.com/SyneRBI/SIRF-SuperBuild/blob/master/docker/requirements.txt in favour of https://github.com/SyneRBI/SIRF/blob/master/requirements.txt ? |
yes, the latter. However, the complication I see is that the VM/docker/superbuild also installs other things than SIRF, which might have their own requirements. Example: SIRF-exercises needs (or could use) Maybe this would all disappear if we'd be able to do a |
Hmm yes, quite. The entire SuperBuild really could disappear if we could In the meantime, we can remove bits of the |
yes. This is getting close to our usual confusion. The SIRF-SuperBuild does (or can do) quite a lot more than building SIRF and its dependencies. So
Tricky bit is that the SIRF clone only happens after the |
I think we're on the same page, but to be explicit: I think confusion/complication here is between the requirements.txt, which is designed to define an environment or runtime, or part thereof, and the definition of dependencies, which should really belong in a setup.py. I've mentioned it super briefly in SyneRBI/SIRF#870. Obviously, dependencies should be transitive, but the requirements.txt isn't really designed that way. You can, as mentioned, effectively "union" environments by using multiple requirements.txt, assuming they don't conflict. I need to look into this a bit more tomorrow though to have a full understanding. For example, I'm not sure when or if SuperBuild handles Python dependencies, but if it could be at the end it wouldn't matter if we have to wait for the sources of each dependency to be pulled, I guess you could grep for a
That's interesting, I always assume the "correct" way would still for CMake to be the installer, and have it run the |
No, the Superbuild doesn't currently install any Python requirements nor tracks them. By the way, |
For clarification, the gold standard would be:
I've done this for other projects but it would take me a few weeks of full time effort to sort it out for SIRF ( There aren't any good template repos I can recommend. The lack of free guidance is frankly due to complexity. People who develop tools to solve this problem don't tend to also provide docs/templates. I've fixed a few bugs in some of said tools, but none of them are documented properly and all of the example/template repos are outdated/broken. Take the SuperBuild itself, for example: even the documentation for how to use it is a minefield - let alone documentation for how to develop it :) |
Hmm, yes that seems rather confusing in the SIRF context. Once you forfeit CMake running the show, then I don't see how the SuperBuild is able to orchestrate making sure libraries align between the various subprojects, and I doubt pip is able to tweak installation options in the way CMake can (e.g., using a specific STIR branch). OTOH, all this hidden from an end-user sounds nice, and that workflow is super simple to anyone using Python.
wow |
I've had a quick search for examples to no avail - SimpleITK and Paraview are two C++/CMake/CMake SuperBuild projects with Python wrappings I know of. But it seems neither are really doing dependency wrapping, although both seem to restrict dependencies to a mimimum. SimpleElastix merges its setup code from SimpleITK. Anyway, an alternative I would see would be declaring the SIRF Python dependencies in the setup.py.in and having them be installed with SIRF's CMake build calls the Python installer. This doesn't get us to |
Actually, that's a question @KrisThielemans . If the SuperBuild did install Python dependencies - where would you want them installed? Logical to me would be the SuperBuild build dir, and then to CMAKE_INSTALL_DIR (e.g. /usr/local) if you run |
Or, from the original description, do you just envisage the SuperBuild spitting out a requirements.txt amalgamated from sub-projects, without installing anything, and then the user can do what they will with that? Sounds like this? pypa/pip#53 |
Since SyneRBI/SIRF#870, SIRF has
requirements.txt
andci-requirements.txt
. We should use this in the SuperBuild, and also for any other projects that have such files, or where we know what they are.I'm not sure how to handle this, but what about making on-the-fly one
requirements.txt
from all the existing ones (and any additions) and install that asenv_sirf_requirements.txt
etc? Might be tricky once version numbers get added in there...The text was updated successfully, but these errors were encountered: