pooch
pooch copied to clipboard
Add FileDownloader class with file:// protocol
Add FileDownloader class with file protocol to allows repository to be e.g. on a network share
Path needs to start with file://.
Relevant issues/PRs: See https://github.com/fatiando/pooch/issues/429
Hi @gyger. Thanks for opening this PR. Sorry for the delayed reply, I spent last week at a conference.
I'll take a look at this soon.
Hi @gyger! This new class looks good! I think it would be a nice addition to Pooch.
A few things that we need to add before we can merge this PR:
- [ ] Unit tests. We would need to add some tests that checks that the downloader works as expected. We could use pytest's
tmp_pathto create temporary locations from where files will be downloaded from. - [ ] Add the new class to the
api/index.rst, under the Downloaders section. - [ ] Import the new class in
pooch/__init__.py, so it becomes available at the top module level.
It would also be nice to include an example in the documentation on use cases for this new downloader.
Let me know if you can and are willing to address these points. Feel free to ask for help if you need it.
I'm eagerly awaiting this PR merge - fantastic idea. I'm happy to help if needed for those final steps, but will await your thoughts @gyger, @santisoler.
Please go ahead modifying the remaining open points. Was occupied with other stuff.
OK, so I've forked and checked out the gyger/file_copy branch. My branch is called file_copy-finalise. Will chip away over the next week or so and submit a PR.
OK, so the final items are done, but just checking in first to potentially avoid creating a separate PR.
I merged the origin to get up to date before starting work, then:
- [x] Unit tests using pytest's tmp_path fixture with near complete coverage of the new code
- [x] Added the new class to the api/index.rst, under the Downloaders section
- [x] Imported the new class in pooch/init.py
- [x] Added progressbar functionality
- [x] Some doc updates, added section to 'Printing progress bars' page
I guess there are two paths forward to merge:
- @gyger merges my branch into theirs to maintain this PR, or
- I create a separate PR.
Seems to me option 1 would be good, but which would you prefer @gyger?
Hi @santisoler, Do you see any issues with this PR now? Is a merge possible?
Hi @elphick. Sorry for the (very) delayed reply. Life got in the way 😬.
I just pushed a few commits that will make the style checks pass. I'll try to come back to this PR soon.
If you want to continue working on it, please check which checks and tests might be failing and try to address them.
Thanks again for the contribution!
Thanks @santisoler - no need for an apology - I know what that's like. I've not yet come across style conformance yet, so please bear with me - will try to learn more about that.