Support for fetching, building and installing mseedindex from pip
Closed this issue · 6 comments
Currently the rover install does not address mseedindex
directly in the pip process. It is only documented that mseedindex
is needed and some steps to get and compile it.
It would be much more friendly to the user if there were a way to do this in a more turn-key way. For example, we could provide an optional target in the pip install, e.g. pip install rover:mseedindex
that would fetch (latest from GitHub), build and install mseedindex
if it was not already installed.
A zip file of the default branch (master) for mseedindex can be fetched from (must follow redirects):
https://api.github.com/repos/iris-edu/mseedindex/zipball
Since mseedindex will always have the latest release on master branch this will be the latest release.
Assuming the python has support for an HTTP fetch, python's builtin zipfile
support could be used to unpack the response.
This whittles the dependencies down to the user having make
and cc
(a C compiler).
instead of the syntax in the original post, the "extras" command I was thinking of is pip install rover[mseedindex]
. So far I have not found a way to allow a custom command to run as the extras_require
setup parameter looks to only be for module dependencies.
As an alternative, some notes to override a command:
https://stackoverflow.com/questions/1321270/how-to-extend-distutils-with-a-simple-post-install-script/1321345#1321345
Thinking out loud, we could either a) override the install
and do the regular thing with an additional check for rover
in the PATH and a YES/NO question that triggers fetch/build/install of mseedindex or b) create another command, e.g. install_mseedindex
, to do our special code.
I now have this so if users run:
pip install rover --install-option="--mseedindex"
or locally
pip install . --install-option="--mseedindex"
or (developer mode)
pip install -e . --install-option="--mseedindex"
then mseedindex will try to automatically be installed.
So when installed via PyPI it would be:
pip install rover --mseedindex
?
I think we need to be smart about allowing someone to do:
pip install rover
followed, once they realize they need mseedindex, by:
pip install rover --mseedindex
Does that work?
Unfortunately I think the only way to pass custom application arguments to pip is by using the --install-option
argument.
Closed. Ultimate approach was to put mseedindex
into PyPI as an independent project, and then support it as an extra dependency for ROVER.