Repository navigation
Fix wrong Zenodo DOI in docs - #339
Merged
Merged
Conversation
lib_doi in .copier-answers.yml was set to the default DOI from the template. Set it to core's concept DOI, as per the Zenodo ADR easyscience/.github#55 Refs #335
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #339 +/- ##
========================================
Coverage 83.24% 83.24%
========================================
Files 63 63
Lines 5324 5324
========================================
Hits 4432 4432
Misses 892 892
Flags with carried forward coverage won't be shown. Click here to find out more. |
Collaborator
Author
Follow-upVersioned docs (or any versions files) could perhaps find a use for the specific version DOI1. Zenodo only creates it after processing the GitHub release, so it can't be templated. However, the public Zenodo REST API2 can look it up by concept ID and tag; I had @claude make this MWE: import json
import sys
import urllib.parse
import urllib.request
CONCEPT_RECID = '19918609' # easyscience/core
def version_dois(tag, concept_recid=CONCEPT_RECID):
query = urllib.parse.urlencode({
'q': f'conceptrecid:{concept_recid} AND metadata.version:"{tag}"',
'all_versions': 'true',
})
with urllib.request.urlopen(f'https://zenodo.org/api/records?{query}') as response:
hits = json.load(response)['hits']['hits']
return [hit['doi'] for hit in hits]
if __name__ == '__main__':
for tag in sys.argv[1:]:
print(tag, version_dois(tag))which returns, > python ~/zenodo_version_doi.py v2.5.1 v2.5.0 v2.3.1
v2.5.1 ['10.5281/zenodo.21719766']
v2.5.0 ['10.5281/zenodo.21718592']
v2.3.1 ['10.5281/zenodo.20024797', '10.5281/zenodo.20026291']If this serves a use, some caveats would also have to be taken into consideration, and an automatic post-release job would:
Footnotes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib_doiin.copier-answers.ymlwas set to the default DOI from the template.This sets it and the docs link to core's concept DOI,
10.5281/zenodo.19918609,as per the Zenodo ADR easyscience/.github#55.
This address #335 wrt to the ADR, which states the DOI should be the Concept DOI, but might not be the full solution that is desired. See my follow-up comment below.