Skip to content

Commit

Permalink
Fix pooch retrieval of file registry
Browse files Browse the repository at this point in the history
We need to specify a filename in `pooch.retrieve` for the file to be correctly overwritten everytime.

If filename is None, it is set as <hash-of-the-url> + <last-part-of-url>. So if the URL stays the same, the file won't be updated, even if the contents are changed

Signed-off-by: sfmig <[email protected]>
  • Loading branch information
sfmig authored Dec 12, 2024
1 parent 3532188 commit 4f6da58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/fixtures/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def pooch_registry() -> dict:
file_registry = pooch.retrieve(
url=f"{GIN_TEST_DATA_REPO}/raw/master/files-registry.txt",
known_hash=None,
fname="files-registry.txt",
# we need to pass a filename otherwise the file is not overwritten every time!
# From the docs: if fname=None, will create a unique file name using
# a combination of the last part of the URL (assuming it’s the file
# name) and the MD5 hash of the URL.
path=Path.home() / ".crabs-exploration-test-data",
)

Expand Down

0 comments on commit 4f6da58

Please sign in to comment.