You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Leftover code in sysconfig.expand_makefile_vars #128978
The _findvar1_rx and _findvar2_rx variables are not declared at all (they were moved to sysconfig/__main__.py). Since the function is publicly named (but not exported nor documented), I prefer backporting the changes of #110785, namely re-use the patterns as is.
I am up to rename it to _expand_makefile_vars, and deprecate expand_makefile_vars. Searching Github for usages of this function (https://github.com/search?q=expand_makefile_vars%20language:Python&type=code&l=Python), I only very few unique usages of it in the wild. And for folks that still need it, as a quick fix, they can add a dependency on setuptools and use distutils.sysconfig.expand_makefile_vars instead.
Activity
vstinner commentedon Jan 20, 2025
Is it time to deprecate this untested and undocumented function?
picnixz commentedon Jan 20, 2025
Probably. It was introduced in 2000 and fixed in 2016 but nothing else: https://github.com/search?q=repo%3Apython%2Fcpython+expand_makefile_vars&type=commits.
So how about I first fix the NameError, then in a follow-up PR, I deprecate the function (so that I can have a dedicated What's New entry)?
picnixz commentedon Jan 20, 2025
Also,
distutilsorgraalpythonseems to provide a (working) bundled version of that function so I don't think we need to worry about?vstinner commentedon Jan 20, 2025
Sure, if we decide to deprecate the function, it should be done in separated change.
gh-128978: Fix a `NameError` in `sysconfig.expand_makefile_vars` (#12…
pythongh-128978: Fix a `NameError` in `sysconfig.expand_makefile_vars` (
pythongh-128978: Fix a `NameError` in `sysconfig.expand_makefile_vars` (
[3.13] gh-128978: Fix a `NameError` in `sysconfig.expand_makefile_var…
FFY00 commentedon Jan 20, 2025
It's sort-of tested throughEdit: It's not.sysconfig.get_paths.sysconfig.get_pathsusessysconfig._expand_vars.I am up to rename it to
_expand_makefile_vars, and deprecateexpand_makefile_vars. Searching Github for usages of this function (https://github.com/search?q=expand_makefile_vars%20language:Python&type=code&l=Python), I only very few unique usages of it in the wild. And for folks that still need it, as a quick fix, they can add a dependency onsetuptoolsand usedistutils.sysconfig.expand_makefile_varsinstead.pythongh-128978: Fix a `NameError` in `sysconfig.expand_makefile_vars` (