Skip to content

Test Python 3.12 support #139

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [2.7, 3.7, 3.8, 3.9, "3.10", 3.11.0]
python-version: [2.7, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12-dev"]
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


steps:
- uses: actions/checkout@v3
Expand All @@ -30,6 +31,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: python -m pip install .[test]
run: python -m pip install --pre .[test]
- name: run tests
run: python run_tests.py
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
]

test_deps = ['gevent>=20.6.2']
test_deps = [
'greenlet>=3.0.0a1', # needed to test Python 3.12 support
'gevent>=20.6.2',
]

setup(
name=NAME,
Expand Down
4 changes: 2 additions & 2 deletions yappi/_yappi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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?

PyGenObject *gen = (PyGenObject *)PyFrame_GetGenerator(frame);
if (gen == NULL) {
return 0;
Expand Down Expand Up @@ -691,7 +691,7 @@ _code2pit(PyFrameObject *fobj, uintptr_t current_tag)
if (cobj->co_argcount) {
// There has been a lot going on with `co_varnames`, but finally in
// 3.11.0rc1, it is added as a public API
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 11
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 11
co_varnames = PyCode_GetVarnames(cobj);
#else
co_varnames = cobj->co_varnames;
Expand Down