Skip to content

Commit

Permalink
Update python-hiredis to version 2.2.2 / rev 8 via SR 1072863
Browse files Browse the repository at this point in the history
https://build.opensuse.org/request/show/1072863
by user mcepl + dimstar_suse
- Update to 2.2.2:
  - Reverting gcc -BSymbolic due to symbol collisions
  - Add pack_command to support writing via hiredis-py
  - Fixing broken windows builds on python < 3.8
  - Fix url in Issue tracker
  - Restores publishing of source distribution
  - Supporting hiredis 1.1.0
  - Modernizing: Restoring CI, Moving to pytest
  - Adding LICENSE to Repository
  - Python 3.11 trove, and links back to the project
  - Integrating release drafter
  - Implement pack_command that serializes redis-py command to
    the RESP bytes object.
- Add 159-sdsalloc-to-alloc.patch (gh#redis/hiredis-py#158),
  which replaces use of sdsalloc with plain alloc.
  • Loading branch information
mcepl authored and bmwiedemann committed Mar 19, 2023
1 parent 72eff9c commit 5ee9cae
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 39 deletions.
Binary file modified packages/p/python-hiredis/.files
Binary file not shown.
23 changes: 23 additions & 0 deletions packages/p/python-hiredis/.rev
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,27 @@
<comment></comment>
<requestid>946784</requestid>
</revision>
<revision rev="8" vrev="1">
<srcmd5>6b68a316fb36f07ebeff2d1f06f9ca56</srcmd5>
<version>2.2.2</version>
<time>1679182350</time>
<user>dimstar_suse</user>
<comment>- Update to 2.2.2:
- Reverting gcc -BSymbolic due to symbol collisions
- Add pack_command to support writing via hiredis-py
- Fixing broken windows builds on python &lt; 3.8
- Fix url in Issue tracker
- Restores publishing of source distribution
- Supporting hiredis 1.1.0
- Modernizing: Restoring CI, Moving to pytest
- Adding LICENSE to Repository
- Python 3.11 trove, and links back to the project
- Integrating release drafter
- Implement pack_command that serializes redis-py command to
the RESP bytes object.
- Add 159-sdsalloc-to-alloc.patch (gh#redis/hiredis-py#158),
which replaces use of sdsalloc with plain alloc.
</comment>
<requestid>1072863</requestid>
</revision>
</revisionlist>
35 changes: 23 additions & 12 deletions packages/p/python-hiredis/0001-Use-system-libhiredis.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,28 @@ Forwarded: no
Last-Updated: 2022-01-15
Patch-Name: 0001-Use-system-libhiredis.patch
---
setup.py 2022-01-15 16:17:07.715728053 +0100 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/setup.py 2021-03-28 17:11:23.000000000 +0200
+++ b/setup.py 2022-01-15 16:17:07.715728053 +0100
@@ -13,7 +13,7 @@ def version():
ext = Extension("hiredis.hiredis",
sources=sorted(glob.glob("src/*.c") +
["vendor/hiredis/%s.c" % src for src in ("alloc", "read", "sds")]),
- include_dirs=["vendor"])
+ extra_link_args=["-lhiredis"])
setup.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

--- a/setup.py
+++ b/setup.py
@@ -26,8 +26,7 @@ def get_linker_args():
if 'win32' in sys.platform or 'darwin' in sys.platform:
return []
else:
- return ["-Wl,-Bsymbolic", ]
-
+ return ["-Wl,-Bsymbolic", "-lhiredis"]

def get_compiler_args():
if 'win32' in sys.platform:
@@ -47,8 +46,7 @@ ext = Extension("hiredis.hiredis",
sources=get_sources(),
extra_compile_args=get_compiler_args(),
extra_link_args=get_linker_args(),
- libraries=get_libraries(),
- include_dirs=["vendor"])
+ libraries=get_libraries())

setup(
name="hiredis",
name="hiredis",
42 changes: 42 additions & 0 deletions packages/p/python-hiredis/159-sdsalloc-to-alloc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From c2a20695aae53de7b5160e29675344df0b805fa6 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sat, 18 Mar 2023 15:18:08 -0400
Subject: [PATCH] pack: Replace sdsalloc.h with alloc.h

Fixes #158.

* src/pack.c: Replace sdsalloc.h with alloc.h.
(pack_command): Replace s_malloc with hi_malloc.
---
src/pack.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/pack.c b/src/pack.c
index 443e9d3..23e4004 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -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)
@@ -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();
@@ -118,4 +118,4 @@ pack_command(PyObject *cmd)
sdsfreesplitres(tokens, tokens_number);
hi_free(lengths);
return result;
-}
\ No newline at end of file
+}
22 changes: 11 additions & 11 deletions packages/p/python-hiredis/drop-vendor-sources.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
setup.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/setup.py 2022-01-15 16:32:39.379711369 +0100
+++ b/setup.py 2022-01-15 16:33:03.091710944 +0100
@@ -11,8 +11,7 @@ def version():
return module.__version__
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ def version():

ext = Extension("hiredis.hiredis",
- sources=sorted(glob.glob("src/*.c") +
- ["vendor/hiredis/%s.c" % src for src in ("alloc", "read", "sds")]),
+ sources=sorted(glob.glob("src/*.c")),
extra_link_args=["-lhiredis"])
def get_sources():
hiredis_sources = ("alloc", "async", "hiredis", "net", "read", "sds", "sockcompat")
- return sorted(glob.glob("src/*.c") + ["vendor/hiredis/%s.c" % src for src in hiredis_sources])
+ return sorted(glob.glob("src/*.c"))

setup(

def get_linker_args():
1 change: 0 additions & 1 deletion packages/p/python-hiredis/hiredis-2.0.0.tar.gz

This file was deleted.

1 change: 1 addition & 0 deletions packages/p/python-hiredis/hiredis-2.2.2.tar.gz
20 changes: 20 additions & 0 deletions packages/p/python-hiredis/python-hiredis.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
-------------------------------------------------------------------
Sat Mar 18 20:17:39 UTC 2023 - Matej Cepl <mcepl@suse.com>

- Update to 2.2.2:
- Reverting gcc -BSymbolic due to symbol collisions
- Add pack_command to support writing via hiredis-py
- Fixing broken windows builds on python < 3.8
- Fix url in Issue tracker
- Restores publishing of source distribution
- Supporting hiredis 1.1.0
- Modernizing: Restoring CI, Moving to pytest
- Adding LICENSE to Repository
- Python 3.11 trove, and links back to the project
- Integrating release drafter
- Implement pack_command that serializes redis-py command to
the RESP bytes object.

- Add 159-sdsalloc-to-alloc.patch (gh#redis/hiredis-py#158),
which replaces use of sdsalloc with plain alloc.

-------------------------------------------------------------------
Sat Jan 15 15:37:17 UTC 2022 - Matthias Fehring <buschmann23@opensuse.org>

Expand Down
33 changes: 18 additions & 15 deletions packages/p/python-hiredis/python-hiredis.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# spec file for package python-hiredis
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -16,9 +16,8 @@
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-hiredis
Version: 2.0.0
Version: 2.2.2
Release: 0
Summary: Python wrapper for hiredis
License: BSD-3-Clause
Expand All @@ -27,9 +26,13 @@ Source: https://files.pythonhosted.org/packages/source/h/hiredis/hiredis
Patch0: 0001-Use-system-libhiredis.patch
# PATCH-FIX-UPSTREAM drop-vendor-sources.patch gh#redis/hiredis-py#90 mcepl@suse.com
# Allow to use platform hiredis libs on build
Patch2: drop-vendor-sources.patch
Patch1: drop-vendor-sources.patch
# PATCH-FIX-UPSTREAM 159-sdsalloc-to-alloc.patch gh#redis/hiredis-py#158 mcepl@suse.com
# Don't use sdsalloc, we actually don't need it
Patch2: 159-sdsalloc-to-alloc.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: hiredis-devel >= 1.0.0
BuildRequires: python-rpm-macros
Expand All @@ -39,23 +42,23 @@ BuildRequires: python-rpm-macros
Python wrapper for hiredis C connector.

%prep
%setup -q -n hiredis-%{version}
%autopatch -p1
%autosetup -p1 -n hiredis-%{version}

%build
%python_build
%pyproject_wheel

%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}

%check
%python_exec setup.py build_ext --inplace
export PYTHONPATH=%{buildroot}%{$python_sitearch}
%python_exec test.py
# %%check
# export PYTHONPATH=%%{buildroot}%%{$python_sitearch}
# %%python_exec test.py

%files %{python_files}
%license COPYING
%{python_sitearch}/*
%license LICENSE
%doc README.md
%{python_sitearch}/hiredis
%{python_sitearch}/hiredis-%{version}*-info

%changelog

0 comments on commit 5ee9cae

Please sign in to comment.