Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-41282: (PEP 632) Deprecate distutils.sysconfig (partial implementation of the PEP) #23142

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

Merged
merged 24 commits into from
Apr 23, 2021
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9de38bb
Mark distutils.sysconfig as deprecated
frenzymadness Oct 15, 2020
2f73368
Import global paths from sysconfig module
frenzymadness Oct 15, 2020
43d810e
Move some similar functions from distutils.sysconfig -> sysconfig
frenzymadness Oct 15, 2020
2ca4dfd
Move the rest of global variables
frenzymadness Oct 15, 2020
09f2617
Move the rest of functions to sysconfig
frenzymadness Oct 15, 2020
24e0584
Import regexes used in tests
frenzymadness Oct 16, 2020
b9ee651
Implement compatibility option for parse_makefile
frenzymadness Oct 16, 2020
12f92cf
Do not use assignment in teardown to not lose reference to global dict
frenzymadness Oct 19, 2020
7b9b0c1
Ignore DeprecationWarning in pip code in ensurepip module
frenzymadness Oct 20, 2020
6f5aa4f
Improve setUp/tearDown of UnixCCompilerTestCase
frenzymadness Oct 20, 2020
fca8adc
Improve or create setUp/tearDown methods for tests where sysconfig._C…
frenzymadness Oct 21, 2020
318428d
Rename `distutils_compat` to `keep_unresolved` and reverse the logic
frenzymadness Oct 23, 2020
6136978
Merge all import from sysconfig to one statement
frenzymadness Oct 23, 2020
e635dbd
Allow import of sysconfig when re module is not available
frenzymadness Oct 23, 2020
d8a8cf0
Add a TODO comment about PEP 632
frenzymadness Oct 23, 2020
e317db5
Mark distutils.sysconfig as deprecated in docs
frenzymadness Oct 23, 2020
17206f0
Copy docs for get_python_inc and get_python_lib from distutils.syscon…
frenzymadness Oct 23, 2020
04ef7af
Move customize_compiler back to distutils.sysconfig as it'll be remov…
frenzymadness Oct 24, 2020
6015255
Fix import of not-yet-initialized _CONFIG_VARS
frenzymadness Nov 3, 2020
abc310b
Switch global vars from regex objects to raw strings and import re on…
frenzymadness Nov 5, 2020
17aa9c4
Move get_python_lib and get_python_inc back to distutils.sysconfig
frenzymadness Nov 13, 2020
be181b6
News entry
frenzymadness Feb 15, 2021
e253a3d
Restore build_flags accidentally removed during a rebase
frenzymadness Apr 16, 2021
cd8e387
Update Doc/distutils/apiref.rst
frenzymadness Apr 18, 2021
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
Prev Previous commit
Next Next commit
Fix import of not-yet-initialized _CONFIG_VARS
  • Loading branch information
frenzymadness committed Apr 16, 2021
commit 60152550f32ca0fbbb09c2bde4f7522f6bc79d7b
11 changes: 7 additions & 4 deletions 11 Lib/distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
_BASE_EXEC_PREFIX as BASE_EXEC_PREFIX,
_PROJECT_BASE as project_base,
_PYTHON_BUILD as python_build,
_CONFIG_VARS as _config_vars,
_init_posix as sysconfig_init_posix,
parse_config_h as sysconfig_parse_config_h,
_parse_makefile as sysconfig_parse_makefile,
Expand All @@ -50,6 +49,12 @@
get_python_lib,
)

# This is better than
# from sysconfig import _CONFIG_VARS as _config_vars
# because it makes sure that the global dictionary is initialized
# which might not be true in the time of import.
_config_vars = get_config_vars()

if os.name == "nt":
from sysconfig import _fix_pcbuild

Expand Down Expand Up @@ -90,9 +95,7 @@ def customize_compiler(compiler):
# that Python itself was built on. Also the user OS
# version and build tools may not support the same set
# of CPU architectures for universal builds.
global _config_vars
# Use get_config_var() to ensure _config_vars is initialized.
if not get_config_var('CUSTOMIZED_OSX_COMPILER'):
if not _config_vars.get('CUSTOMIZED_OSX_COMPILER'):
import _osx_support
_osx_support.customize_compiler(_config_vars)
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.