Enable testing for Python 3.12 and PyPy 3.10 on CI#1435
Enable testing for Python 3.12 and PyPy 3.10 on CI#1435seratch merged 1 commit intoslackapi:mainfrom
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. |
seratch
left a comment
There was a problem hiding this comment.
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.
This was just missing! Thank you!
.github/workflows/ci-build.yml
Outdated
| 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.
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.
| 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.
Indeed, the warnings are noisy. Filtering them out would be fine
| 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.
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: |
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, |
seratch
left a comment
There was a problem hiding this comment.
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.pypytestto 7.xflake8to allowpipdo its job and resolve compatibility issuesflake8errorssetup.pyTestInteractionsWebsockets.test_interactionsBest regards!
Category (place an
xin 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
xin each[ ])rundebbuged everything on CI after making the changes.python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh