Description
Caveat: I have very little experience with proposing and implementing substantial new features/APIs in open-source projects.
There have been more than a few requests to add functionality to twine check
, but those have been mostly flagged as duplicates of #430, which is currently blocked on pypa/packaging#147, which hasn't seen much movement.
#843 contains a proposal to add custom "checkers" via setuptools entry_points
, which would allow functionality to be added by independently-maintained packages. Twine already allows for plugin sub-commands via entry_points
, but those would have to implement argument parsing and reading packages from disk, and be run as a separate command from twine check
.
The purpose of this issue is to gather requirements and propose an API for custom checkers. For an initial (but insufficient) overview of the current API, see the autodoc for twine.commands.check
.
Some initial ideas/questions:
- Currently, the only check is for
long_description
, implemented in a private method. That should eventually be refactored to match the new API, but it could be refactored earlier to help establish the new API. - What are some examples of custom checks that people would like to write? Can we/they share example implementations to drive the API design?
- What attributes of a package do people want to check? Presumably metadata, which is available via
PackageFile
, along with the original filename. - What lessons can we learn from other tools that offer plugin functionality, e.g. flake8?
- How should/must the new API be documented before it's implemented?
- I'm assuming we want/need to maintain the API of
check()
andmain()
intwine.commands.check
.