GH-127178: improve compatibility in `_sysconfig_vars_(...).json` by FFY00 · Pull Request #128558 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 41 additions & 20 deletions Lib/sysconfig/__init__.py
6 changes: 5 additions & 1 deletion Lib/sysconfig/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,14 @@ def _generate_posix_vars():

print(f'Written {destfile}')

install_vars = get_config_vars()
# Fix config vars to match the values after install (of the default environment)
install_vars['projectbase'] = install_vars['BINDIR']
install_vars['srcdir'] = install_vars['LIBPL']
# Write a JSON file with the output of sysconfig.get_config_vars
jsonfile = os.path.join(pybuilddir, _get_json_data_name())
with open(jsonfile, 'w') as f:
json.dump(get_config_vars(), f, indent=2)
json.dump(install_vars, f, indent=2)

print(f'Written {jsonfile}')

Expand Down
17 changes: 15 additions & 2 deletions Lib/test/test_sysconfig.py