Skip to content

Deprecate sysconfig.expand_makefile_vars #129064

Closed
@picnixz

Description

@picnixz

Feature or enhancement

Proposal:

Per #128978, the function was not working (since 3.13 after 4a53a39) because of a NameError. There are very few occurrences of that function: https://github.com/search?q=expand_makefile_vars+language%3APython&type=code&l=Python and most of them are actually bundled (and working) versions of that function using distutils.sysconfig.expand_makefile_vars instead of sysconfig.expand_makefile_vars.

Since distutils was removed in Python 3.12, users will need to access sysconfig.expand_makefile_vars directly if they use it (and if the function is called!). Now, AFAIK, there are some usages in the wild (e.g., https://github.com/ncbi/ncbi-cxx-toolkit-public/blob/52b6b3c2cea0af8553b026f84cb697afb16ecb64/src/dbapi/lang_bind/python/setup.py#L66) that could hit it at runtime, so if they decide to drop distutils support for whatever reason, and use our sysconfig, they would be a bit annoyed =/

So we can either decide to deprecate it (since it's not documented nor tested actually), or we can document it and properly test it. It's easy to deprecate it but it would add some burden on downstream users, so maybe we can just test it and document it?

cc @vstinner

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions