Skip to content

Conversation

@elprans
Copy link
Contributor

@elprans elprans commented Mar 13, 2025

Most Linux distributions allow installing multiple versions of
Python side-by-side, where binaries are installed as /usr/bin/pythonX.Y
and headers are installed into /usr/include/pythonX.Y.

On such system PET will look for the first patchlevel.h header found in
/usr/include, which would basically be the first Python version in the
directory iteration order.

Fix this by only considering versions that match the MAJOR.MINOR
version found in pyvenv.cfg of the environment (if one exists). This
is valid, because major Python upgrades almost always require the
environment to be re-created.

Most Linux distributions allow installing multiple versions of
Python side-by-side, where binaries are installed as `/usr/bin/pythonX.Y`
and headers are installed into `/usr/include/pythonX.Y`.

On such system PET will look for the first `patchlevel.h` header found in
`/usr/include`, which would basically be the first Python version in the
directory iteration order.

Fix this by only considering versions that match the `MAJOR.MINOR`
version found in `pyvenv.cfg` of the environment (if one exists).  This
is valid, because major Python upgrades almost always require the
environment to be re-created.
@vs-code-engineering vs-code-engineering bot added this to the March 2025 milestone Mar 24, 2025
@DonJayamanne DonJayamanne merged commit 845945b into microsoft:main Mar 24, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants