For various reasons, I’m trying to build python-apt 1.8.4.x against CPython 3.9.1 (built from source, no patches). I’m doing this because I’m using Python 3.9.1 on Debian Buster systems, which have apt 1.x and not apt 2.x, so I can’t build the more recent versions of python-apt
(they build fine).
When I run ‘pip install .’ using the latest versions of pip/wheel/etc., the wheel gets built, but then during installation the process stops with this message:
(ansible) root@git20:~/python-apt# pip install .
Processing /root/python-apt
Building wheels for collected packages: python-apt
Building wheel for python-apt (setup.py) ... done
Created wheel for python-apt: filename=python_apt-1.8.4.9-cp39-cp39-linux_x86_64.whl size=1890745 sha256=fc9fd3e73bf003c10b2d5f76c181e3881a08e441eb6aeb51466dce64a47fe0bc
Stored in directory: /root/.cache/pip/wheels/1e/bd/d1/2a3e340a78d2cee74643902ccfc6bf3765428bab95bcbb7e93
Successfully built python-apt
Installing collected packages: python-apt
Attempting uninstall: python-apt
Found existing installation: python-apt 1.8.4.2
Uninstalling python-apt-1.8.4.2:
Successfully uninstalled python-apt-1.8.4.2
Rolling back uninstall of python-apt
Moving to /opt/ansible/lib/python3.9/site-packages/apt/
from /opt/ansible/lib/python3.9/site-packages/~pt
Moving to /opt/ansible/lib/python3.9/site-packages/apt_inst.cpython-39-x86_64-linux-gnu.so
from /tmp/pip-uninstall-r37h7b8x/apt_inst.cpython-39-x86_64-linux-gnu.so
Moving to /opt/ansible/lib/python3.9/site-packages/apt_pkg.cpython-39-x86_64-linux-gnu.so
from /tmp/pip-uninstall-r37h7b8x/apt_pkg.cpython-39-x86_64-linux-gnu.so
Moving to /opt/ansible/lib/python3.9/site-packages/aptsources/
from /opt/ansible/lib/python3.9/site-packages/~ptsources
Moving to /opt/ansible/lib/python3.9/site-packages/python_apt-1.8.4.2.dist-info/
from /opt/ansible/lib/python3.9/site-packages/~ython_apt-1.8.4.2.dist-info
ERROR: For req: python-apt==1.8.4.9. Unexpected file in /root/.cache/pip/wheels/1e/bd/d1/2a3e340a78d2cee74643902ccfc6bf3765428bab95bcbb7e93/python_apt-1.8.4.9-cp39-cp39-linux_x86_64.whl: 'python_apt-1.8.4.9.data/purelib'. .data directory contents should be named like: '<scheme key>/<path>'.
I suppose there’s something about this package’s structure (or setup.py contents) which are not compatible with ‘modern’ versions of the packaging tools, and for Debian this doesn’t matter because this branch will only ever be packaged for Debian Buster which has older versions of all of the tools (and Python 3.7).
Any packaging gurus that could give me a hint as to what I could change to make this work?