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

Modernizing: Restoring CI, Moving to pytest #136

Merged
merged 29 commits into from
Dec 12, 2022
Merged

Conversation

chayim
Copy link
Contributor

@chayim chayim commented Nov 29, 2022

This PR modernizes the hiredis-py build and test cycles. Builds will now run tests, in parallel in pytest - replacing Travis.

This change also makes it possible to release, via the release drafter, to PyPI, once I add the appropriate secrets to repository. This follows the same method as redis-py, whereby making a release using the release drafter, triggers the pypi publish.

In the case, the release publish will in parallel, build wheels for all the associated platforms. These wheels are then collected, and uploaded to pypi. Testing everything other than the upload can be found in this action run.

closes #120
closes #122
closes #124
closes #129
closes #130
closes #121
closes #118

@chayim chayim changed the title Moving to GitHub actions Modernizing: Restoring CI, Moving to pytest Nov 30, 2022
@chayim
Copy link
Contributor Author

chayim commented Nov 30, 2022

@illia-v So here we are. CI is better, migrations to pytest happened. You'll note that this now runs python 3.7-3.10, and on windows, mac, and linux. BUT: On python 3.8-3.10 core dumps after the tests complete. Any chance you can help out with that?

@ifduyue
Copy link
Collaborator

ifduyue commented Nov 30, 2022

@chayim I've found what caused this bug, below is the patch:

diff --git a/src/reader.c b/src/reader.c
index bf99b58..b472c24 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -288,9 +288,12 @@ static int Reader_init(hiredis_ReaderObject *self, PyObject *args, PyObject *kwd
         if (!_Reader_set_exception(&self->replyErrorClass, replyErrorClass))
             return -1;
 
-    if (notEnoughData)
+    if (notEnoughData) {
+        Py_DECREF(self->notEnoughDataObject);
         self->notEnoughDataObject = notEnoughData;
-
+        Py_INCREF(self->notEnoughDataObject);
+    }
+
     return _Reader_set_encoding(self, encoding, errors);
 }
 
@@ -375,6 +378,7 @@ static PyObject *Reader_gets(hiredis_ReaderObject *self, PyObject *args) {
     }
 
     if (obj == NULL) {
+        Py_INCREF(self->notEnoughDataObject);
         return self->notEnoughDataObject;
     } else {
         /* Restore error when there is one. */

@chayim
Copy link
Contributor Author

chayim commented Nov 30, 2022

First off awesome. But... We should contribute back to hiredis. Mind cross linking the PR there? @michael-grunder would probably love that?

@michael-grunder
Copy link
Contributor

Always happy for PRs, but I don't see any changes to hiredis here.

Unless I'm missing something, the above patch just modifies hiredis-py's reader.

@ifduyue
Copy link
Collaborator

ifduyue commented Dec 1, 2022

the above patch just modifies hiredis-py's reader.

yes, it's hiredis-py/src/reader.c

@chayim
Copy link
Contributor Author

chayim commented Dec 1, 2022

Sorry guys - this was on mobile, I didn't realize it was in src/reader.c. Ignore my comment.

@chayim
Copy link
Contributor Author

chayim commented Dec 1, 2022

Okay.. the wheel list is very impressive here. I need a bit to figure out how to make this Github Actions-able, across all of these platforms. Unless someone else knows :p

@chayim
Copy link
Contributor Author

chayim commented Dec 6, 2022

The newly built wheel list - what will now be uploaded. Note python 3.10, and 3.11 are now included.

hiredis-2.0.0-cp310-cp310-macosx_10_12_universal2.whl
hiredis-2.0.0-cp310-cp310-macosx_10_12_x86_64.whl
hiredis-2.0.0-cp310-cp310-macosx_11_0_arm64.whl
hiredis-2.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
hiredis-2.0.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl
hiredis-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-cp310-cp310-musllinux_1_1_aarch64.whl
hiredis-2.0.0-cp310-cp310-musllinux_1_1_i686.whl
hiredis-2.0.0-cp310-cp310-musllinux_1_1_ppc64le.whl
hiredis-2.0.0-cp310-cp310-musllinux_1_1_s390x.whl
hiredis-2.0.0-cp310-cp310-musllinux_1_1_x86_64.whl
hiredis-2.0.0-cp311-cp311-macosx_10_12_universal2.whl
hiredis-2.0.0-cp311-cp311-macosx_10_12_x86_64.whl
hiredis-2.0.0-cp311-cp311-macosx_11_0_arm64.whl
hiredis-2.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
hiredis-2.0.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
hiredis-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-cp311-cp311-musllinux_1_1_aarch64.whl
hiredis-2.0.0-cp311-cp311-musllinux_1_1_i686.whl
hiredis-2.0.0-cp311-cp311-musllinux_1_1_ppc64le.whl
hiredis-2.0.0-cp311-cp311-musllinux_1_1_s390x.whl
hiredis-2.0.0-cp311-cp311-musllinux_1_1_x86_64.whl
hiredis-2.0.0-cp37-cp37m-macosx_10_12_x86_64.whl
hiredis-2.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
hiredis-2.0.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl
hiredis-2.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-cp37-cp37m-musllinux_1_1_aarch64.whl
hiredis-2.0.0-cp37-cp37m-musllinux_1_1_i686.whl
hiredis-2.0.0-cp37-cp37m-musllinux_1_1_ppc64le.whl
hiredis-2.0.0-cp37-cp37m-musllinux_1_1_s390x.whl
hiredis-2.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl
hiredis-2.0.0-cp38-cp38-macosx_10_12_universal2.whl
hiredis-2.0.0-cp38-cp38-macosx_10_12_x86_64.whl
hiredis-2.0.0-cp38-cp38-macosx_11_0_arm64.whl
hiredis-2.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
hiredis-2.0.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl
hiredis-2.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-cp38-cp38-musllinux_1_1_aarch64.whl
hiredis-2.0.0-cp38-cp38-musllinux_1_1_i686.whl
hiredis-2.0.0-cp38-cp38-musllinux_1_1_ppc64le.whl
hiredis-2.0.0-cp38-cp38-musllinux_1_1_s390x.whl
hiredis-2.0.0-cp38-cp38-musllinux_1_1_x86_64.whl
hiredis-2.0.0-cp39-cp39-macosx_10_12_universal2.whl
hiredis-2.0.0-cp39-cp39-macosx_10_12_x86_64.whl
hiredis-2.0.0-cp39-cp39-macosx_11_0_arm64.whl
hiredis-2.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
hiredis-2.0.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl
hiredis-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-cp39-cp39-musllinux_1_1_aarch64.whl
hiredis-2.0.0-cp39-cp39-musllinux_1_1_i686.whl
hiredis-2.0.0-cp39-cp39-musllinux_1_1_ppc64le.whl
hiredis-2.0.0-cp39-cp39-musllinux_1_1_s390x.whl
hiredis-2.0.0-cp39-cp39-musllinux_1_1_x86_64.whl
hiredis-2.0.0-pp37-pypy37_pp73-macosx_10_12_x86_64.whl
hiredis-2.0.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl
hiredis-2.0.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl
hiredis-2.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hiredis-2.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hiredis-2.0.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
hiredis-2.0.0-cp310-cp310-win32.whl
hiredis-2.0.0-cp310-cp310-win_amd64.whl
hiredis-2.0.0-cp311-cp311-win32.whl
hiredis-2.0.0-cp311-cp311-win_amd64.whl
hiredis-2.0.0-cp37-cp37m-win32.whl
hiredis-2.0.0-cp37-cp37m-win_amd64.whl
hiredis-2.0.0-cp38-cp38-win32.whl
hiredis-2.0.0-cp38-cp38-win_amd64.whl
hiredis-2.0.0-cp39-cp39-win32.whl
hiredis-2.0.0-cp39-cp39-win_amd64.whl
hiredis-2.0.0-pp37-pypy37_pp73-win_amd64.whl
hiredis-2.0.0-pp38-pypy38_pp73-win_amd64.whl
hiredis-2.0.0-pp39-pypy39_pp73-win_amd64.whl

@chayim chayim marked this pull request as ready for review December 6, 2022 16:42
@chayim chayim requested a review from a team December 6, 2022 16:42
setup.py Outdated Show resolved Hide resolved
@chayim
Copy link
Contributor Author

chayim commented Dec 7, 2022

@DvirDukhan you might be interested in the GitHub CI side of this

@chayim
Copy link
Contributor Author

chayim commented Dec 7, 2022

@ifduyue Given these changes, I'm voting for 2.1.0 on hiredis. I'll send up a PR after this one, to release. Fair?

@chayim chayim mentioned this pull request Dec 7, 2022
@ifduyue
Copy link
Collaborator

ifduyue commented Dec 8, 2022

@chayim looks good, ship it!

@chayim chayim merged commit 861539c into redis:master Dec 12, 2022
@chayim chayim deleted the ck-modernize branch December 12, 2022 07:07
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
fail-fast: false
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Copy link

Choose a reason for hiding this comment

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

Why do you need it? I don't see any need for that as no need to run deprecated commands set-env and add-path.

miketheman added a commit to miketheman/warehouse that referenced this pull request Dec 16, 2022
Back in pypi#4584 we switched to using a source distribution.
This was circa hiredis 0.2.0.

As of hiredis 2.1.0, no source distributions are provided to PyPI, so
this step fails to install any updated requirements.

Refs: redis/hiredis-py#136

Signed-off-by: Mike Fiedler <[email protected]>
miketheman added a commit to miketheman/warehouse that referenced this pull request Dec 16, 2022
Back in pypi#4584 we switched to using a source distribution.
This was circa hiredis 0.2.0.

As of hiredis 2.1.0, no source distributions are provided to PyPI, so
this step fails to install any updated requirements.

Refs: redis/hiredis-py#136

Signed-off-by: Mike Fiedler <[email protected]>
ewdurbin pushed a commit to pypi/warehouse that referenced this pull request Dec 16, 2022
* Bump hiredis from 2.0.0 to 2.1.0

Bumps [hiredis](https://github.com/redis/hiredis-py) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/redis/hiredis-py/releases)
- [Changelog](https://github.com/redis/hiredis-py/blob/master/CHANGELOG.md)
- [Commits](redis/hiredis-py@v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: hiredis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: use compiled hiredis

Back in #4584 we switched to using a source distribution.
This was circa hiredis 0.2.0.

As of hiredis 2.1.0, no source distributions are provided to PyPI, so
this step fails to install any updated requirements.

Refs: redis/hiredis-py#136

Signed-off-by: Mike Fiedler <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Mike Fiedler <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release for supporting Python 3.10 New release for cp3.10 is not on pypi Bump hiredis version to 1.0.2
6 participants