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

Test Python 3.12 support #139

Closed
wants to merge 4 commits into from
Closed

Test Python 3.12 support #139

wants to merge 4 commits into from

Conversation

pquentin
Copy link

@pquentin pquentin commented Jun 9, 2023

I'm trying to add support for the Python 3.12 betas in elastic/rally#1730, but am hitting this error:

  × Building wheel for yappi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-312
      copying yappi/yappi.py -> build/lib.linux-x86_64-cpython-312
      running build_ext
      building '_yappi' extension
      creating build/temp.linux-x86_64-cpython-312
      creating build/temp.linux-x86_64-cpython-312/yappi
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DLIB_RT_AVAILABLE=1 -I/home/runner/work/rally/rally/.nox/test-3-12/include -I/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/include/python3.12 -c yappi/_yappi.c -o build/temp.linux-x86_64-cpython-312/yappi/_yappi.o
      yappi/_yappi.c: In function ‘IS_SUSPENDED’:
      yappi/_yappi.c:240:18: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
        240 |     return (frame->f_stacktop != NULL);
            |                  ^~
      yappi/_yappi.c: In function ‘_code2pit’:
      yappi/_yappi.c:697:29: error: ‘PyCodeObject’ has no member named ‘co_varnames’; did you mean ‘co_names’?
        697 |         co_varnames = cobj->co_varnames;
            |                             ^~~~~~~~~~~
            |                             co_names
      yappi/_yappi.c: In function ‘IS_SUSPENDED’:
      yappi/_yappi.c:242:1: warning: control reaches end of non-void function [-Wreturn-type]
        242 | }
            | ^
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

@@ -224,7 +224,7 @@ static void _DebugPrintObjects(unsigned int arg_count, ...)

int
IS_SUSPENDED(PyFrameObject *frame) {
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 11
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 11
Copy link
Author

Choose a reason for hiding this comment

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

This is unlikely to be enough, according to a comment below there are APIs in Python 3.12 to do that now?

@pquentin
Copy link
Author

pquentin commented Jun 9, 2023

Your own CI is blocked by python-greenlet/greenlet#327

@pquentin pquentin mentioned this pull request Jun 9, 2023
2 tasks
@pquentin
Copy link
Author

pquentin commented Jul 3, 2023

@sumerc greenlet has issued a pre-release with Python 3.12 support, which fixed yappis's CI. You can see the tests passing here with greenlet 3.0.0a1 and my changes: https://github.com/pquentin/yappi/actions/runs/5440881956/jobs/9894253241. What do you think?

Note that GitHub Actions no longer supports Python 2.7, are you ready to drop support? I can do that in a different pull request.

@jcapiitao
Copy link

I submitted the PR #145 to remove support of Python2.7

Copy link

@jcapiitao jcapiitao left a comment

Choose a reason for hiding this comment

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

Hi @pquentin
I wrote some minor comments

Cheers

@@ -50,20 +50,22 @@
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',

Choose a reason for hiding this comment

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

exclude:
- os: windows-latest
python-version: 2.7 # error: Microsoft Visual C++ 9.0 is required
# - os: macos-latest
# python-version: 3.9 # TODO: getting Illegal instruction somehow
continue-on-error: true

Choose a reason for hiding this comment

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

This can be remove once the PR rebased on top of #145

@pquentin
Copy link
Author

Thanks for the review. However this was more a proof of concept and I have a lost interest since then. Feel free to reuse my pull request, it has the same license as the code itself. Thanks again!

@pquentin pquentin closed this Jul 24, 2023
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.

None yet

2 participants