Skip to content
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

fix docs build command on different global and venv python versions #5360

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nikulpatel3141
Copy link

@nikulpatel3141 nikulpatel3141 commented Sep 8, 2024

Description

The build command in the docs fails when using a python venv with a different version to the global installation as python3-config will use the global one.

For example on a machine with global python 3.12 in a venv using python 3.11:

(venv) $ python3-config --extension-suffix  # .cpython-311-x86_64-linux-gnu.so

(venv) $ python3 -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))'  # .cpython-312-x86_64-linux-gnu.so

This silently causes a 'ModuleNotFound' error as the venv cannot import the generated pybind module.

Suggested changelog entry:

Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Is this needed because venv does not cover the python3-config command?

... after looking for 5 minutes ...

pypa/virtualenv#169

Apparently that's still an issue.

Waiting for a day or so for feedback from @henryiii

@henryiii
Copy link
Collaborator

I wonder if we should just bite the bullet and provide a --extension-suffix flag on pybind11-config?

@rwgk
Copy link
Collaborator

rwgk commented Sep 27, 2024

I wonder if we should just bite the bullet and provide a --extension-suffix flag on pybind11-config?

Sounds good to me.

Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii self-requested a review as a code owner September 27, 2024 21:15
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