Skip to content

[Feature Request] Public interface for _msvccompiler._get_vc_env #340

@ghost

Description

pytorch's repository is using an import of setuptools / distutil.

https://github.com/pytorch/pytorch/blob/main/tools/build_pytorch_libs.py#L17-L25

def _get_vc_env(vc_arch: str) -> dict[str, str]:
    try:
        from setuptools import distutils  # type: ignore[import]

        return distutils._msvccompiler._get_vc_env(vc_arch)  # type: ignore[no-any-return]
    except AttributeError:
        from setuptools._distutils import _msvccompiler  # type: ignore[import]

        return _msvccompiler._get_vc_env(vc_arch)  # type: ignore[no-any-return]

However, its location/implementation is being changed and causing the errors as follows:

AttributeError: module 'distutils._msvccompiler' has no attribute '_get_vc_env'

Example issues:
pypa/setuptools#4874
pytorch/pytorch#148877
pytorch/pytorch#141319


Could you please open a reliable public interface for _get_vc_env , so pytorch 's repository could be updated to use that import for the future versions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions