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

python 3.12 #274

Open
loriab opened this issue Oct 31, 2023 · 6 comments
Open

python 3.12 #274

loriab opened this issue Oct 31, 2023 · 6 comments

Comments

@loriab
Copy link
Collaborator

loriab commented Oct 31, 2023

Just a PSA that pylibint isn't working nicely with python 3.12. I see it locally on Linux, and GHA hits it on Mac.

There's some setup.py test complaints, but even running unittest directly, the third test segfaults. I haven't had problems with py312 and other pybind11 projects, so I'm not sure what's the trouble.

Anyways, this doesn't hinder me, but I'm posting in case others hit it. (If it's needed for CI before #271 is merged, change python3 -> [email protected] for homebrew.)

@e-kwsm
Copy link
Contributor

e-kwsm commented Oct 31, 2023

setuptools v41.5.0 deprecated the test command https://setuptools.pypa.io/en/latest/history.html#v41-5-0.

@e-kwsm
Copy link
Contributor

e-kwsm commented Oct 31, 2023

I tried to build libint exported from ca32e0c, with python 3.11 and pybind11 v2.6.0 as downloaded by libint, but failed:

In file included from exported/build/_deps/pybind11-src/include/pybind11/attr.h:13,
                 from exported/build/_deps/pybind11-src/include/pybind11/pybind11.h:45,
                 from exported/python/src/libint2/libint2.cc:13:
build/_deps/pybind11-src/include/pybind11/cast.h: In function ‘std::string pybind11::detail::error_string()’:
build/_deps/pybind11-src/include/pybind11/cast.h:446:36: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  446 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
      |                                    ^~

See https://docs.python.org/3.11/whatsnew/3.11.html#pyframeobject-3-11-hiding and pybind/pybind11#4464.
pybind11 v2.10.0 or later is required.

@e-kwsm
Copy link
Contributor

e-kwsm commented Oct 31, 2023

With pybind11 v2.10.0, python3 setup.py test fails but it seems unrelated with libint.

@loriab
Copy link
Collaborator Author

loriab commented Oct 31, 2023

Thanks for investigating. fwiw, I was using pybind11 v2.11.1 .

@loriab
Copy link
Collaborator Author

loriab commented Nov 13, 2023

So CI is failing again (see #262, #275, #276) on Mac once these were rebased to include the homebrew [email protected] workaround to py312 failure.

My theory is that the GHA macOS image has, for a long time, had an old Python. https://github.com/actions/runner-images#available-images shows macos-latest bringing py27 (not a typo: 2.7). In this case, the homebrew upgrades python. And because homebrew "features" a weird-to-me takeover of system Python, pylibint2 finds the new py311, and all's well.

In my experience, even requesting macos-latest sometimes brings a variety of images (system python not always ==py27) as GHA rolls out runner images. So what the L2 CI is now seeing is the new macos-13 that comes with py312. Then homebrew declines to downgrade python to 311, and pylibint2 picks up py312 and fails.

Idk which of the three following strategies should be pursued:

@evaleev
Copy link
Owner

evaleev commented Nov 22, 2023

There's some setup.py test complaints, but even running unittest directly, the third test segfaults. I haven't had problems with py312 and other pybind11 projects, so I'm not sure what's the trouble.

I think support for 3.12 may not be complete even in pybind11 master. In Libint2's python "unit" test I seemed to have run into this problem when trying 3.12 with master pybind11:

image

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

No branches or pull requests

3 participants