Skip to content

Fix missing release dates in plugin list generator - #15466

Open
ShivBoyPro wants to merge 1 commit into
pytest-dev:mainfrom
ShivBoyPro:fix-plugin-list-missing-release-date
Open

ShivBoyPro wants to merge 1 commit into
pytest-dev:mainfrom
ShivBoyPro:fix-plugin-list-missing-release-date

Conversation

@ShivBoyPro

Copy link
Copy Markdown

The plugin-list generator does not initialize last_release for each
package. If a package has no release files, it either raises
UnboundLocalError or reuses the previous package’s release date.

This change initializes last_release to "N/A" for each package,
while preserving the existing date calculation when release files exist.

Regression tests cover empty release histories and releases without
files, both as the first package and after a package with a valid date.
The tests use mocked responses and make no network requests.

Validation:

  • All four regression cases fail without the fix and pass with it.
  • All applicable pre-commit checks pass.
  • git diff --check passes.

AI assistance:
I used ChatGPT/Codex to identify the potential bug and draft the fix
and regression tests. I reviewed the changes, discussed how the fix
works, and ran the reproduction, tests, and checks locally.

Assisted-by: OpenAI ChatGPT/Codex

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.

The bug is real but small: on today's PyPI three plugins (pytest-bigchaindb, pytest-gcov, pytest-nocustom) have releases without files, and the current plugin list shows the previous row's date for each. The UnboundLocalError case only happens if the alphabetically first plugin has no files.

Two changes please:

  • A project with no release files cannot be installed, so don't list it. Emit a short warning naming the project (e.g. tqdm.write(f"skipping {name}: no release files", file=sys.stderr)) and continue, instead of listing it with N/A.
  • Drop testing/test_update_plugin_list.py. Its dependencies are only installed in the update-plugin-list tox env, which runs the script but never pytest, so the test is skipped everywhere it would run. A test that never runs gives false confidence. If you want the script tested, please open a follow-up issue proposing how to run such tests in CI safely (no network), e.g. by splitting the pure PyPI-JSON-to-row logic into functions that need only stdlib + packaging, so the regular suite can test them.

Generated by Claude Code

This branch has not been deployed

No deployments
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