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

distutils/setuptools: need to provide _distutils_system_mod #2313

Closed
0-wiz-0 opened this issue Mar 8, 2022 · 4 comments
Closed

distutils/setuptools: need to provide _distutils_system_mod #2313

0-wiz-0 opened this issue Mar 8, 2022 · 4 comments

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Mar 8, 2022

setuptools added support for a _distutils_system_mod override file to distutils.
pypa/setuptools#2896

This allows packaging systems to override particular distutils defaults with their preferred solution.

This is how pkgsrc uses the override file:

# _distutils_system_mod

import distutils.sysconfig


vars(distutils.sysconfig).update(
    _makefile_tmpl='config-{python_ver}{build_flags}',
    _sysconfig_name_tmpl='_sysconfigdata_{platform}',
)

Virtualenv does not seem to be aware of this file, and does not copy it in the virtual environments. Thus installing packages will fail in such virtual environments.
Example bug report:
TritonDataCenter/pkgsrc#323

The error is

  ModuleNotFoundError: No module named '_sysconfigdata__sunos5_'

because the override for _sysconfig_name_tmpl is not considered, because the _distutils_system_mod file is not available in the virtual environment.

Please copy this file (.../site-packages/_distutils_system_mod.py) if it is available.

@gaborbernat
Copy link
Contributor

gaborbernat commented Mar 8, 2022

A PR trying to achieve this would be welcome 👍 (with changelog entry and tests).

@0-wiz-0
Copy link
Author

0-wiz-0 commented Mar 8, 2022

@gaborbernat I know nothing about the codebase. Any pointers on where I should look first? Thanks.

@gaborbernat
Copy link
Contributor

@gaborbernat
Copy link
Contributor

With 3.12 no longer adding setuptools this is no longer valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants