Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError when scheme hacks encounter missing purelib. #2936

Open
1 task done
pawl opened this issue Dec 20, 2021 · 1 comment
Open
1 task done

KeyError when scheme hacks encounter missing purelib. #2936

pawl opened this issue Dec 20, 2021 · 1 comment
Labels
Needs Investigation Issues which are likely in scope but need investigation to figure out the cause

Comments

@pawl
Copy link

pawl commented Dec 20, 2021

setuptools version

v59.8.0

Python version

3.8.12

OS

Ubuntu 21.04

Additional environment information

No response

Description

Until recently, kombu was using some code like this hack to copy data files into the module directory.

Now we're seeing this error:

Traceback (most recent call last):
File "setup.py", line 60, in
scheme['data'] = scheme['purelib']
KeyError: 'purelib'

Because in v59.8.0 osx_framework_user was added to INSTALL_SCHEMES and it doesn't defined the purelib part of the dict.

Should that new osx_framework_user have purelib defined? If it's not necessary, maybe it's best these old hacks break and requiring changing code to use MANIFEST.in like this other SO post suggests?: https://stackoverflow.com/a/1857436

Expected behavior

That new osx_framework_user in INSTALL_SCHEMES should have purelib defined?

How to Reproduce

Run:

from distutils.command.install import INSTALL_SCHEMES

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

on v59.8.0

Output

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
KeyError: 'purelib'

Code of Conduct

  • I agree to follow the PSF Code of Conduct
@pawl pawl added bug Needs Triage Issues that need to be evaluated for severity and status. labels Dec 20, 2021
@jaraco
Copy link
Member

jaraco commented Dec 20, 2021

Thank you for the report. The reason that only headers is defined for osx framework user is because that scheme is meant to extend a scheme in sysconfig and is only relevant if that scheme is in sysconfig. It would be possible to add a full copy of what is likely found in sysconfig in order to meet the expectations of the aforementioned hack.

My preference would be for the hack to adjust its expectations or to remove the hack altogether if possible, but I realize that may not be possible in all scenarios.

How much disruption would it be to leave the issue in place given there are workarounds, such as pinning old Setuptools or using SETUPTOOLS_USE_DISTUTILS=stdlib in affected environments?

alexsavulescu added a commit to neuronsimulator/nrn that referenced this issue Dec 20, 2021
alkino added a commit to BlueBrain/nmodl that referenced this issue Dec 20, 2021
@jaraco jaraco changed the title [BUG] KeyError when scheme hacks encounter missing purelib. Dec 21, 2021
@jaraco jaraco added Needs Investigation Issues which are likely in scope but need investigation to figure out the cause and removed bug Needs Triage Issues that need to be evaluated for severity and status. labels Dec 21, 2021
alkino added a commit to BlueBrain/nmodl that referenced this issue Dec 21, 2021
* Pin setuptools due to a bug in the last version

pypa/setuptools#2936

* Fix syntax
olupton pushed a commit to BlueBrain/nmodl that referenced this issue Dec 21, 2021
* Pin setuptools due to a bug in the last version

pypa/setuptools#2936

* Fix syntax
alexsavulescu added a commit to neuronsimulator/nrn that referenced this issue Jan 27, 2022
alexsavulescu added a commit to neuronsimulator/nrn that referenced this issue Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation Issues which are likely in scope but need investigation to figure out the cause
Projects
None yet
Development

No branches or pull requests

2 participants