Skip to content

PyPI: populate RichResult timestamp metadata - #344

Merged
lilydjwg merged 1 commit into
lilydjwg:masterfrom
lorepirri:pypi-creation-time
Aug 4, 2026
Merged

PyPI: populate RichResult timestamp metadata#344
lilydjwg merged 1 commit into
lilydjwg:masterfrom
lorepirri:pypi-creation-time

Conversation

@lorepirri

Copy link
Copy Markdown
Contributor

Populate RichResult.creation_time for PyPI releases using metadata already available in the existing PyPI JSON response.

A PyPI version may contain multiple distribution files, each with its own upload_time_iso_8601. This change uses the earliest available file upload timestamp as the release creation time.

No additional HTTP requests are introduced.

PyPI object creation_time revision_creation_time
Release/version Earliest available upload_time_iso_8601 among its distribution files None

The implementation preserves the current behavior for:

  • yanked releases
  • prerelease filtering
  • invalid versions
  • empty historical releases
  • list options and final version selection

If a release has no files, or none of its files provides upload_time_iso_8601, creation_time remains None.

Tests cover:

  • a normal single-file release
  • releases with multiple files
  • selection of the earliest timestamp independent of file ordering
  • files with missing timestamps
  • releases without an available timestamp
  • existing live PyPI version-selection behavior

The PyPI documentation now includes the corresponding RichResult metadata table.

@lilydjwg
lilydjwg merged commit 2cb4a41 into lilydjwg:master Aug 4, 2026
17 checks passed
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