Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into return-sets-as-lists
Browse files Browse the repository at this point in the history
  • Loading branch information
gerzse committed Jul 19, 2024
2 parents 61918d6 + a94bb44 commit 40dc08a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/REUSABLE-wheeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
MACOSX_DEPLOYMENT_TARGET: "10.15"
Expand All @@ -32,70 +32,69 @@ jobs:

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.19.2
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones
CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}-wheels
path: ./wheelhouse/*.whl

build_sdist:
name: Build source dist
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build sdist
run: |
python3 setup.py sdist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: source-dist
path: ./dist/*.tar.gz

publish:
name: Pypi publish
if: ${{inputs.release == true}}
# needs: ['build_wheels', 'build_sdist']
needs: ['build_wheels', 'build_sdist']
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.10'
- name: Install tools
run: |
pip install twine wheel
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ubuntu-20.04-wheels
name: ubuntu-latest-wheels
path: artifacts/linux
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: windows-2019-wheels
name: windows-latest-wheels
path: artifacts/windows
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: macos-latest-wheels
path: artifacts/macos
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: source-dist
path: artifacts/sdist
- name: unify wheel structure
- name: Unify wheel structure
run: |
mkdir dist
cp -R artifacts/windows/* dist
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pip install hiredis
Building this repository requires a recursive checkout of submodules, and building hiredis. The following example shows how to clone, compile, and run tests. Please note - you will need the gcc installed.

```bash
git clone --recursse-submodules https://github.com/redis/hiredis-py
git clone --recurse-submodules https://github.com/redis/hiredis-py
python setup.py build_ext --inplace
python -m pytest
```
Expand Down
2 changes: 1 addition & 1 deletion hiredis/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.3.2"
__version__ = "2.4.0"
6 changes: 3 additions & 3 deletions src/pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern sds sdscpylen(sds s, const char *t, size_t len);
extern sds sdsnewlen(const void *init, size_t initlen);
#endif

#include <hiredis/sdsalloc.h>
#include <hiredis/alloc.h>

PyObject *
pack_command(PyObject *cmd)
Expand All @@ -32,7 +32,7 @@ pack_command(PyObject *cmd)
}

Py_ssize_t tokens_number = PyTuple_Size(cmd);
sds *tokens = s_malloc(sizeof(sds) * tokens_number);
sds *tokens = hi_malloc(sizeof(sds) * tokens_number);
if (tokens == NULL)
{
return PyErr_NoMemory();
Expand Down Expand Up @@ -118,4 +118,4 @@ pack_command(PyObject *cmd)
sdsfreesplitres(tokens, tokens_number);
hi_free(lengths);
return result;
}
}

0 comments on commit 40dc08a

Please sign in to comment.