pypa / pypa/setuptools

KeyError when scheme hacks encounter missing purelib.

Open
#2,936 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Investigation
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with distutils.command.install.INSTALL_SCHEMES and reproduce the KeyError using the Python snippet in the issue on setuptools v59.8.0. Inspect the osx_framework_user scheme and determine whether its missing purelib entry should be defined; done means the reproduction no longer raises the reported KeyError or the expected compatibility behavior is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.