Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Zenodo urls with slashes in the filename #340

Merged
merged 6 commits into from
Feb 15, 2023
Merged

Conversation

santisoler
Copy link
Member

@santisoler santisoler commented Feb 11, 2023

Allow DOIDownloader to work with files uploaded to Zenodo that have a forward slash "/" in their name. These special cases are generated by the Zenodo-GitHub integration service, where the first portion of the filename matches the GitHub handle of the repository owned and the last portion matches the repository name. Now the parse_url function handles Zenodo dois under a special case: the netloc will be formed with the first two "parts" (prefix/suffix), while the path will be formed by everything that follows the second slash.

Relevant issues/PRs:

Fixes #336, fixes #341 and outperforms the idea drafted in #337

Try another way of supporting Zenodo urls that have slashes in the
filename.
Test the parse_url and the DOIDownloader against a Zenodo url that
contains a slash in the path.
@santisoler
Copy link
Member Author

santisoler commented Feb 11, 2023

@djmannion, can you confirm that this other patch works locally for you? I think this a much better solution that the one before.

@santisoler santisoler marked this pull request as ready for review February 11, 2023 20:04
@djmannion
Copy link

Yes, confirming that this version fixes my issue - and not having to specifically handle the extra slash is great from a user perspective, thanks!

This allows to reuse this function in future tests, instead of having to
hardcode the doi multiple times. Simplify the process in case we need to
update that Zenodo repository and get a new doi.
Add a new test function that checks if populating the registry with the
`load_registry_from_doi` method works as expected when the repo is
a Zenodo one with slashes in the filename.
@santisoler
Copy link
Member Author

Nice to hear that @djmannion. I'm merging this. I'm planning to make a Pooch release before the end of the month, so this bugfix will be available very soon.

@santisoler santisoler merged commit d579cf6 into main Feb 15, 2023
@santisoler santisoler deleted the doi-zenodo-github branch February 15, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants