1

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?

auvipy
  • 769
  • 10
  • 22
  • I see the same issue in another library: File "/tmp/pip-install-29lo1sxq/mysql-connector_180023bd264b44c0b10131020cf8a9e8/setup.py", line 44, in install_scheme['data'] = install_scheme['purelib'] KeyError: 'purelib' – sonium Dec 22 '21 at 20:43
  • I followed this as temporary solution https://stackoverflow.com/a/70451233/3544931 – auvipy Dec 23 '21 at 11:32

3 Answers3

2

I downgraded to setuptools==58.2.0 and now it works fine again.

0

I'm getting the same error as you. Staging server setup last week works, production this week does not, same versions of python, same versions of the libraries. Not sure what changed.

Either way:

try adding this to your pip install:

SETUPTOOLS_USE_DISTUTILS=stdlib pip install .... 

As mentioned from setuptools issue

  • I also tried downgrading versions which were not effected, but still not luck. have to check your solution thanks. – auvipy Dec 21 '21 at 11:49
  • I told a contributor to open the issue haha https://github.com/pypa/setuptools/issues/2936 – auvipy Dec 21 '21 at 11:50
0

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

auvipy
  • 769
  • 10
  • 22