Skip to content

distutils/setuptools: need to provide _distutils_system_mod #2313

@0-wiz-0

Description

@0-wiz-0

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions