-
Notifications
You must be signed in to change notification settings - Fork 835
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
Enable testing for Python 3.12 and PyPy 3.10 on CI #1435
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1435 +/- ##
==========================================
+ Coverage 85.38% 85.45% +0.06%
==========================================
Files 111 111
Lines 12134 12113 -21
==========================================
- Hits 10361 10351 -10
+ Misses 1773 1762 -11 ☔ View full report in Codecov by Sentry. |
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.
Thank you very much for sending such a great pull request! I appreciate your time and efforts here. One thing I would like to revise is that we can simplify the test settings for PyPy runtime. I believe running tests with the latest version should be enough for this project as most users are with CPython, plus I don't think this SDK can have issues with specific version of PyPy considering its functionalities.
matrix: | ||
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] | ||
python-version: | ||
- '3.12' |
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 was just missing! Thank you!
.github/workflows/ci-build.yml
Outdated
@@ -23,12 +36,17 @@ jobs: | |||
uses: actions/setup-python@v4 | |||
with: | |||
python-version: ${{ matrix.python-version }} | |||
cache: pip | |||
- name: Install compatible cryptography | |||
if: matrix.python-version == 'pypy3.7' || matrix.python-version == 'pypy3.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.
We'd like to avoid making the build settings complex just to support old pypy versions. Can you remove pypy 3.6 to 3.9? I don't believe this SDK can cause issues only for old pypy runtimes as this SDK mainly does web API calls, parsing HTTP request data, and database access.
@@ -6,4 +6,5 @@ log_date_format = %Y-%m-%d %H:%M:%S | |||
filterwarnings = | |||
ignore:"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning | |||
ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning | |||
ignore:slack.* package is deprecated. Please use slack_sdk.* package instead.*:UserWarning |
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.
Indeed, the warnings are noisy. Filtering them out would be fine
@@ -90,7 +90,9 @@ async def socket_mode_listener( | |||
expected.sort() | |||
|
|||
count = 0 | |||
while count < 10 and len(received_messages) < len(expected): | |||
while count < 10 and ( | |||
len(received_messages) < len(expected) or len(received_socket_mode_requests) < len(socket_mode_envelopes) |
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.
good catch!
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! It took me well over an hour to figure out what's going on with PyPy (and CPython from time to time) and complete this PR 😅
TimestampType = TypeVar("TimestampType", float, int) | ||
|
||
|
||
def _timestamp_to_type(ts: Union[TimestampType, datetime, str], target_type: Type[TimestampType]) -> TimestampType: |
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.
nice refactoring
These changes also: * resolve/suppress some warnings * update classifiers at setup.py * bump pytest to 7.x * update constraints for flake8 to allow pip do its job and resolve compatibility issues * refactor timestamp conversion logic in order to resolve a bunch of E721 flake8 errors * fix some regexes with invalid escaping at setup.py * fix spontaneous failures of TestInteractionsWebsockets.test_interactions
dcc95b6
to
ec27bf0
Compare
Hello @seratch, |
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.
Looks great to me now! Thank you so much again for the great contribution!
Summary
Hello,
I believe it would be nice to ensure support for Python 3.12 and PyPy,
so I'd like to suggest changes that:
setup.py
pytest
to 7.xflake8
to allowpip
do its job and resolve compatibility issuesflake8
errorssetup.py
TestInteractionsWebsockets.test_interactions
Best regards!
Category (place an
x
in each of the[ ]
)/docs-src
(Documents, have you run./scripts/docs.sh
?)/docs-src-v2
(Documents, have you run./scripts/docs-v2.sh
?)/tutorial
(PythOnBoardingBot tutorial)tests
/integration_tests
(Automated tests for this library)Requirements (place an
x
in each[ ]
)rundebbuged everything on CI after making the changes.python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh