Skip to content

Deprecate sysconfig.expand_makefile_vars #129064

Closed

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

Activity

  1. added
    type-featureA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directory
    on Jan 20, 2025
  2. tomasr8 commented on Jan 20, 2025

    @tomasr8
    Member

    Seems like a best-case scenario for deprecation given that the function was broken for all this time and nobody (apparently?) noticed

  3. picnixz commented on Jan 20, 2025

    @picnixz
    MemberAuthor

    Ok, my bad but it was only broken in 3.13+. I thought it was 3.12 but I misread the change history. So 3.12 is working, but 3.13 and 3.14 are broken.

  4. FFY00 commented on Jan 20, 2025

    @FFY00
    Member

    Cross-posting from the duplicated issue I open in GH-129075.

    This function has been broken since v3.13.0a1 (see GH-128978), and nobody noticed. It was originally meant to posteriorly expand the values from sysconfig.get_paths(..., expand=False), which achieves the same as passing a custom vars argument to sysconfig.get_paths, a function that is actually tested.

  5. added a commit that references this issue on Jan 20, 2025
  6. added a commit that references this issue on Jan 20, 2025
  7. picnixz commented on Jan 20, 2025

    @picnixz
    MemberAuthor

    Considering it has been decided to be deprecated, I'm going to close this issue. Thanks for the PR by the way!

  8. vstinner commented on Jan 20, 2025

    @vstinner
    Member

    The documentation is not rendered properly:

    The ~sysconfig.expand_makefile_vars function has been deprecated ...

    I'm talking about the ~ character.

  9. picnixz commented on Jan 20, 2025

    @picnixz
    MemberAuthor

    This character is not needed actually (since there is no documentation, we can decide not to use :func: as well). Reopening until this has been fixed (just to remember).

  10. changed the title [-]Deprecate or properly document and test `sysconfig.expand_makefile_vars`[/-] [+]Deprecate `sysconfig.expand_makefile_vars`[/+] on Jan 20, 2025
  11. added a commit that references this issue on Jan 21, 2025
  12. added a commit that references this issue on Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions