packaging
packaging copied to clipboard
plugin system for tags
According to PEP 425, "tools should use the most-preferred architecture dependent tag e.g. cp33-cp33m-win32 or the most-preferred pure python tag e.g. py33-none-any by default."
If we can get those tools to import the same list of tags then bdist_wheel
would give all new wheels with C extensions the tag tags[0]
and pip would install them.
We could give packaging.tags
a config Python script that could change the list of tags. Then BSD users (who have said the default tag is not useful for them) or cluster users could use appropriate tags without having to pass special arguments to every invocation of install or build tools. This would remove the need for a global standard or a separate "no manylinux" config.
For example try: import _filter_tags; tags = _filter_tags.filter(default_tags)
, or check a config file for the import if that's not too strange a beast. By accepting a list of tags from packaging.tags a filter could change the list of tags without having to necessarily generate them all itself.
@cjerdonek I'm not thrilled with this example of a plugin system
Do note that with #231 that various functions will be exposed which might help make it easier to control things.
Could this be as simple as a tags.ini
in some well-known (sys.prefix
?) location that just inserts any tags ahead of what sys_tags returns? (As in, sys_tags
finds and yields those tags first, then goes on to its normal behaviour.)
I think we want it in here so that build tools and install tools that share packaging
can pick up the same tag without (tools or users) having to do extra work.
An interface to control tags like that, whether it's some kind of text file or a python API should be a PEP so we don't privilege this particular implementation of tagging.