pooch icon indicating copy to clipboard operation
pooch copied to clipboard

Add FileDownloader class with file:// protocol

Open gyger opened this issue 1 year ago • 7 comments

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

gyger avatar Jul 02 '24 00:07 gyger

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.

santisoler avatar Jul 18 '24 00:07 santisoler

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_path to 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.

santisoler avatar Dec 06 '24 22:12 santisoler

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.

elphick avatar Apr 03 '25 00:04 elphick

Please go ahead modifying the remaining open points. Was occupied with other stuff.

gyger avatar Apr 03 '25 02:04 gyger

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.

elphick avatar Apr 11 '25 11:04 elphick

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:

  1. @gyger merges my branch into theirs to maintain this PR, or
  2. I create a separate PR.

Seems to me option 1 would be good, but which would you prefer @gyger?

elphick avatar Apr 16 '25 00:04 elphick

Hi @santisoler, Do you see any issues with this PR now? Is a merge possible?

elphick avatar May 28 '25 00:05 elphick

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!

santisoler avatar Aug 29 '25 21:08 santisoler

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.

elphick avatar Aug 31 '25 13:08 elphick