✨ feat(info): expose debug build status#79
Merged
Conversation
virtualenv needs to know whether a target interpreter is a debug build to correctly handle Windows debug executables (python_d.exe, venvlauncher_d.exe), matching CPython venv behavior. Cache compatibility is automatic: _py_info.py is hashed by the caching layer, so adding a new field changes the hash and forces re-probe of stale entries. Also flattened _find_possible_exe_names with itertools.product to stay within the nesting limit after adding debug suffix variants.
70138ca to
f860843
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CPython venv on Windows handles debug builds by looking for
python_d.exeandvenvlauncher_d.exe, but virtualenv has no way to detect whether a target interpreter is a debug build. 🔍 This blocks virtualenv from matching CPython venv's behavior for debug Python installations.PythonInfonow readsPy_DEBUGfromsysconfig(following the same pattern asfree_threaded/Py_GIL_DISABLED) and exposes it asdebug_build. Thespecproperty includes adsuffix for debug interpreters, and_find_possible_exe_namesgenerates_dexecutable name variants so discovery can locate debug builds on Windows.Cache compatibility requires no special handling. The caching layer hashes
_py_info.pyto detect staleness, so adding the new field automatically invalidates old cache entries and forces a fresh probe. New cache entries read by older python-discovery versions are also safe sincefrom_dictassigns all dict keys to__dict__and the extradebug_buildkey is silently ignored.