-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support and test PyPy 3.7 #1516
Changes from all commits
1db09bd
6ec453b
244f55f
7a34f0d
fb8df61
19667fe
9616f6a
a225560
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
import warnings | ||
from asyncio import iscoroutine | ||
from functools import wraps | ||
from sys import exc_info, version_info | ||
from sys import exc_info, implementation, version_info | ||
from typing import Optional | ||
|
||
import attr | ||
|
@@ -1459,8 +1459,11 @@ def _inlineCallbacks(result, g, status): | |
# code. | ||
appCodeTrace = exc_info()[2].tb_next | ||
|
||
# The contextvars backport and our no-op shim add an extra frame. | ||
if version_info < (3, 7): | ||
# The contextvars backport and our no-op shim add an extra frame. | ||
appCodeTrace = appCodeTrace.tb_next | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so is the logic basically like:
|
||
elif implementation.name == "pypy": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like pypy 3.5, pypy 3.6, and pypy 3.7 behave differently. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Current PyPy doesn't support 3.5. Do we need to add it into the mix? I'm not sure offhand if the action provides it but we can try. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like https://github.com/actions/setup-python#available-versions-of-pypy Since we we specified There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you manually install the last Pypy 3.5 release from: And manually run I just want to double check, just in case there is a remote possibility that someone out there is running Pypy 3.5 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. $ git rev-parse HEAD
a225560007f04235596992da561adcf686c118ab $ git diff
diff --git a/src/twisted/logger/_buffer.py b/src/twisted/logger/_buffer.py
index f90f8f982..3334f97e9 100644
--- a/src/twisted/logger/_buffer.py
+++ b/src/twisted/logger/_buffer.py
@@ -7,7 +7,7 @@ Log observer that maintains a buffer.
"""
from collections import deque
-from typing import Deque, Optional
+from typing import Optional
from zope.interface import implementer
$ venvpp35/bin/python --version --version
Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)
[PyPy 7.0.0 with GCC 8.2.0] $ venvpp35/bin/trial twisted.internet.test.test_inlinecb
twisted.internet.test.test_inlinecb
CancellationTests
test_asynchronousCancellation ... [OK]
test_cascadeCancellingOnCancel ... [OK]
test_errbackCancelledErrorOnCancel ... [OK]
test_errorToErrorTranslation ... [OK]
test_errorToSuccessTranslation ... [OK]
ForwardTraceBackTests
test_forwardLotsOfTracebacks ... [OK]
test_forwardTracebacks ... [OK]
NonLocalExitTests
test_returnValueNonLocalDeferred ... [OK]
test_returnValueNonLocalWarning ... [OK]
StopIterationReturnTests
test_returnWithValue ... [OK]
-------------------------------------------------------------------------------
Ran 10 tests in 0.135s
PASSED (successes=10) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also full tox passed. https://gist.github.com/altendky/8fab0cac9a0be55f2d836bcc018c6637 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's good enough for me. |
||
# PyPy as of 3.7 adds an extra frame. | ||
appCodeTrace = appCodeTrace.tb_next | ||
|
||
if isFailure: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PyPy 3.7 is now tested and supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should keep pypy3 here, in addition to adding pypy-3.6 and pypy-3.7.
Then after this release, we can remove pypy3 and keep pypy-3.6+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that
pypy3
refers to 3.6. What do we need to keep it around for?https://github.com/twisted/twisted/runs/1905976630?check_suite_focus=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looks like specifying
pypy3
in GitHub actions installs pypy3 compatible with Python 3.6.12.So I think your change is fine, not worth fighting with GitHub about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is fine.