Fixing devpi package uploads in a Python 3.6.5 world
Upgrading our virtualenv builds to use Python 3.6.5 and the latest versions of setuptools, wheel, pip, and virtualenv broke publication. We use a private devpi server and it rejected the new packages with the error devpi upload does not contain PKGINFO, skipping. This post explains the error cause and how to work around it until a permanent fix for devpi-client 4.0.1 is in place.
What's wrong with the build?
pkginfo provides metadata to package management tools. The most current versions of the setuptools/wheel combination rely on a different metadata format that devpi (and maybe other tools) cannot parse.
The problem manifests itself in devpi with the error:
devpi upload some-package.whl does not contain PKGINFO, skipping
This occurs because devpi-client in te the build machine uses a version of pkginfo earlier than 1.4.2.
Install pkginfo 1.4.2 or later in the same Python environment hosting devpi-client and devpi-common. Our build systems use the global Python 3 installation for this. Substitute the pip command with the corresponding pip, pip2, or pip3 as appropriate.
pip3 install -U pkginfo && pip3 list --format=columns | grep pkginfo # Output: pkginfo 1.4.2
That's it - build and publish as always, devpi-client will upload the package without further incident.
These instructions will be deprecated when devpi-client pins pkginfo>=1.4.2 some time in the future.