Add support for creating pyX providers
Add support for creating pyX providers
Now all python packages that install python modules under /usr/lib/pythonX.Y/site-packages will have a provider that indicates their MAJOR version, the X in the path.
pyX maps to the MAJOR version of the package, its objective is to allow
users to quickly install a python module without having to search around
for the correct package, doing apk add py3:foo
will install whatever
packages provides the foo module.
The directories checked only go one level deep, so
'/usr/lib/python3.8/site-packages/date' will generate
py3:date=pkgver-r
pkgrel.
files ending with .py also count and are added with their .py prefix
stripped away. so '/usr/lib/python3.8/site-packages/six.py' will
generate py3:six=pkgver-r
pkgrel.
The reason for doing this is the same as creating pc:, so: and cmd:, it is more reliable and robust to depened on what we known of what the package provides than to try to guess via the pkgname.
Note that this is not perfect but is a trade-off, this will not protect against installed the wrong MINOR version of the module, it is entirely possible to install py3:foo but get a foo in /usr/lib/python3.7 while one is using /usr/lib/python3.8, this was a concious decision made to avoid annoying users with gratiutious breaking messages.