Skip to content

chore(tasks): remove dead tasks/check.py and its invoke wiring (closes #827)#1275

Open
r266-tech wants to merge 2 commits into
pypa:mainfrom
r266-tech:r266-remove-dead-tasks-check-827
Open

chore(tasks): remove dead tasks/check.py and its invoke wiring (closes #827)#1275
r266-tech wants to merge 2 commits into
pypa:mainfrom
r266-tech:r266-remove-dead-tasks-check-827

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Closes #827. Picks up the "Simplifications" item from #1239.

tasks/check.py is a ~10-year-dead invoke task: it imports the deprecated pkg_resources and calls PyPI XML-RPC methods that were removed years ago, so it fails on import (#827), and it is not run by CI or nox.

Per @henryiii's removal recipe in #1239, this also drops the now-orphaned wiring:

  • tasks/__init__.py — only existed to namespace check (invoke.Collection(check))
  • tasks/requirements.txtinvoke + progress, used only by check.py
  • types-invoke from the pre-commit mypy additional_dependencies
  • the progress.* / pkg_resources entries from the mypy import-ignore override
  • the "tasks/check.py" = ["UP032"] ruff per-file-ignore

I verified repo-wide that invoke, check.pep440, pkg_resources, progress, and types-invoke are referenced only by the deleted files. The remaining tasks/*.py (check_frozen_revs, licenses, paths, pickle_compat, select_pypi_*) are standalone scripts importing only stdlib + packaging.* with no relative imports, so removing the package __init__.py does not affect them (noxfile only calls tasks/licenses.py).

One note: tasks/paths.py (defines CACHE) is now referenced only by the removed check.py. I left it in place to match the exact recipe, but happy to drop it too if you'd prefer.

Closes pypa#827. tasks/check.py is a ~10-year-dead invoke task: it imports the
deprecated pkg_resources and calls PyPI XML-RPC methods removed years ago, so it
fails on import (pypa#827). It is not run by CI or nox.

Per @henryiii's removal recipe in pypa#1239, this also drops the now-orphaned wiring:
tasks/__init__.py (only namespaced check), tasks/requirements.txt (invoke +
progress, used only by check), the types-invoke pre-commit mypy dep, the
progress.*/pkg_resources mypy import-ignore overrides, and the tasks/check.py ruff
per-file-ignore. The remaining tasks/*.py are standalone scripts (stdlib +
packaging.* only, no relative imports), so removing the package init does not
affect them.
@henryiii

Copy link
Copy Markdown
Contributor

Okay to drop that tasks/paths.py too, IMO.

@r266-tech

r266-tech commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Done — pushed a small CI follow-up in 0454857 that restores a minimal tasks/__init__.py package marker so Ruff no longer reports INP001 on the remaining task helpers.

I left tasks/paths.py in place for now: it is importable as tasks.paths, and keeping it avoids broadening this PR beyond the dead check.py cleanup while still fixing the failing lint job.

@notatallshaw

notatallshaw commented Jun 27, 2026

Copy link
Copy Markdown
Member

@r266-tech all your recent comments have initially been something like this before editing:

@/tmp/packaging-1275-comment.md

Github sends out the first comment via email, it doesn't wait to edit. Please fix this, it makes it difficult to follow progress from emails.

@r266-tech

Copy link
Copy Markdown
Contributor Author

Sorry about the email noise — that was a bug in my comment tooling. It was writing each reply to a temp file and the first POST sent the literal @/tmp/...md path, then a follow-up edit swapped in the real text (so the corrected version never reached the notification email). I've fixed it to send the full comment in the initial request with no post-hoc edits. Thanks for flagging it.

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.

task: check.pep440 fails on importing pkg_resources and then on running the actual task

3 participants