Closed NickSwainston closed 3 years ago
After doing the usual google search of how to solve the problem, I found this stake overflow page: https://stackoverflow.com/questions/37513279/using-setuptools-how-can-i-download-external-data-upon-installation It warns "Python package installs should be completely reproducible, and any potential external-download issues should be pushed to runtime" so I wrote the script in the above way.
The write permission issue can be solved by running python -c "import mwa_pb.config"
the first time it is installed (by someone with the correct permissions). If you would still prefer the h5 file to be downloading during installation I can move it to setup.py if you wish.
Nick
After some discussion, we decided the best implementation would be to download the h5 file before the setup function so it will be wheeled into the dist files and uploaded to pypi to assure the installation works with all methods.
I shall merge the changes when the review is approved.
Sorry Nick, I didn't notice this. I've just merged the change.
Hi Nick, that fix is only going to work if the person running the code that imports mwa_pb has write permission in the directory where mwa_pb is installed. That'll be true if it's installed in their home directory in a local python environment, but won't be in a lot of other cases, like on Galaxy, or the Django servers running the web services.
Why not put the code to download the file in setup.py, so it happens before the package is installed?
Andrew
On 2020-07-21 1:49 PM, Nick Swainston wrote: