Skip to content

Generalize Zenodo publish script for future releases - #41

Closed
brunomartinsmv wants to merge 1 commit into
mainfrom
cursor/zenodo-publish-improvements-9b63
Closed

Generalize Zenodo publish script for future releases#41
brunomartinsmv wants to merge 1 commit into
mainfrom
cursor/zenodo-publish-improvements-9b63

Conversation

@brunomartinsmv

Copy link
Copy Markdown
Owner

Follow-up to PR #38 addressing the automated review suggestions for maintainability before the next release.

Changes

  • Dynamic metadata: _build_metadata() loads base fields from .zenodo.json and derives publication_date plus the GitHub changelog anchor from CHANGELOG.md for the requested tag.
  • HTTP timeouts: All Zenodo and GitHub requests use a default 120s timeout (configurable via --timeout).
  • Clearer download errors: _download() wraps HTTP/URL failures in ZenodoError, matching _request().
  • --dry-run: Creates and updates a draft deposition without calling actions/publish, useful for CI debugging.
  • Tests: Six unit tests cover metadata building, changelog parsing, download error handling, dry-run flow, and missing-token CLI validation.

Testing

  • python -m ruff check scripts/publish_zenodo_release.py tests/test_publish_zenodo_release.py
  • python -m pytest tests/test_publish_zenodo_release.py -v
  • python -m scripts.publish_zenodo_release --help
Open in Web Open in Cursor 

Load base metadata from .zenodo.json and derive publication_date and
changelog anchor from CHANGELOG.md per tag. Add HTTP timeouts, clearer
download errors, --dry-run for draft-only CI debugging, and unit tests.

Co-authored-by: Bruno <brunomartinsmv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants