Search code examples
pythonsetuptoolsdistutils

Python distutils keyError


I had a working code of disutils in setup.py file like the following

from distutils.command.install import INSTALL_SCHEMES

for scheme in list(INSTALL_SCHEMES.values()):
    scheme['data'] = scheme['purelib']

but today I got the following error while trying to run CI in github action

Traceback (most recent call last):
  File "/home/runner/work/kombu/kombu/setup.py", line 60, in <module>
    scheme['data'] = scheme['purelib']
KeyError: 'purelib'

I have not got enough resource to figure out the solution, yes distutils is deprecated, but as the code was working until today morning, can anyone please point me to the right fix?


Solution

  • restricting setuptools in CI help to get rid of this regression https://github.com/celery/kombu/commit/c4a8c2a69f0caad080984e466a5ccdb4be068373 https://github.com/celery/kombu/pull/1466

    Also removing the distutils hack from setup.py is still under consideration in near future https://github.com/celery/kombu/pull/1467.

    ref Including non-Python files with setup.py