Skip to content

Deprecate sysconfig.expand_makefile_vars #129064

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

Closed
picnixz opened this issue Jan 20, 2025 · 6 comments
Closed

Deprecate sysconfig.expand_makefile_vars #129064

picnixz opened this issue Jan 20, 2025 · 6 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@picnixz
Copy link
Member

picnixz commented Jan 20, 2025

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

@picnixz picnixz added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Jan 20, 2025
@tomasr8
Copy link
Member

tomasr8 commented Jan 20, 2025

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

@picnixz
Copy link
Member Author

picnixz commented Jan 20, 2025

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.

@FFY00
Copy link
Member

FFY00 commented Jan 20, 2025

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.

FFY00 added a commit to FFY00/cpython that referenced this issue Jan 20, 2025
@picnixz picnixz marked this as a duplicate of #129075 Jan 20, 2025
@picnixz
Copy link
Member Author

picnixz commented Jan 20, 2025

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

@picnixz picnixz closed this as completed Jan 20, 2025
@vstinner
Copy link
Member

The documentation is not rendered properly:

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

I'm talking about the ~ character.

@picnixz
Copy link
Member Author

picnixz commented Jan 20, 2025

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).

@picnixz picnixz reopened this Jan 20, 2025
@picnixz picnixz changed the title Deprecate or properly document and test sysconfig.expand_makefile_vars Deprecate sysconfig.expand_makefile_vars Jan 20, 2025
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 21, 2025
picnixz added a commit that referenced this issue Jan 21, 2025
This amends the NEWS and What's New entries introduced in 0a6412f.
@picnixz picnixz closed this as completed Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants