-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make it work with newer hiredis & upgrade CI python versions
- Loading branch information
Showing
6 changed files
with
75 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.2.0" | ||
__version__ = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
#!/usr/bin/env python | ||
|
||
try: | ||
from setuptools import setup, Extension | ||
from setuptools.command import install_lib as _install_lib | ||
from setuptools import setup, Extension | ||
from setuptools.command import install_lib as _install_lib | ||
except ImportError: | ||
from distutils.core import setup, Extension | ||
from distutils.command import install_lib as _install_lib | ||
import sys, imp, os, glob | ||
from distutils.core import setup, Extension | ||
from distutils.command import install_lib as _install_lib | ||
import imp | ||
import glob | ||
|
||
|
||
def version(): | ||
module = imp.load_source("hiredis.version", "hiredis/version.py") | ||
return module.__version__ | ||
module = imp.load_source("hiredis.version", "hiredis/version.py") | ||
return module.__version__ | ||
|
||
|
||
# Patch "install_lib" command to run build_clib before build_ext | ||
# to properly work with easy_install. | ||
# See: http://bugs.python.org/issue5243 | ||
class install_lib(_install_lib.install_lib): | ||
def build(self): | ||
if not self.skip_build: | ||
if self.distribution.has_pure_modules(): | ||
self.run_command('build_py') | ||
if self.distribution.has_c_libraries(): | ||
self.run_command('build_clib') | ||
if self.distribution.has_ext_modules(): | ||
self.run_command('build_ext') | ||
def build(self): | ||
if not self.skip_build: | ||
if self.distribution.has_pure_modules(): | ||
self.run_command('build_py') | ||
if self.distribution.has_c_libraries(): | ||
self.run_command('build_clib') | ||
if self.distribution.has_ext_modules(): | ||
self.run_command('build_ext') | ||
|
||
|
||
# To link the extension with the C library, distutils passes the "-lLIBRARY" | ||
# option to the linker. This makes it go through its library search path. If it | ||
|
@@ -41,43 +45,44 @@ def build(self): | |
# | ||
# Also see: https://github.com/pietern/hiredis-py/issues/15 | ||
lib = ("hiredis_for_hiredis_py", { | ||
"sources": ["vendor/hiredis/%s.c" % src for src in ("read", "sds")]}) | ||
"sources": ["vendor/hiredis/%s.c" % src for src in ("read", "sds")]}) | ||
|
||
ext = Extension("hiredis.hiredis", | ||
sources=sorted(glob.glob("src/*.c")), | ||
include_dirs=["vendor"]) | ||
sources=sorted(glob.glob("src/*.c")), | ||
include_dirs=["vendor"]) | ||
|
||
setup( | ||
name="hiredis", | ||
version=version(), | ||
description="Python wrapper for hiredis", | ||
url="https://github.com/redis/hiredis-py", | ||
author="Jan-Erik Rediger, Pieter Noordhuis", | ||
author_email="[email protected], [email protected]", | ||
keywords=["Redis"], | ||
license="BSD", | ||
packages=["hiredis"], | ||
libraries=[lib], | ||
ext_modules=[ext], | ||
name="hiredis", | ||
version=version(), | ||
description="Python wrapper for hiredis", | ||
url="https://github.com/redis/hiredis-py", | ||
author="Jan-Erik Rediger, Pieter Noordhuis", | ||
author_email="[email protected], [email protected]", | ||
keywords=["Redis"], | ||
license="BSD", | ||
packages=["hiredis"], | ||
libraries=[lib], | ||
ext_modules=[ext], | ||
|
||
# Override "install_lib" command | ||
cmdclass={ "install_lib": install_lib }, | ||
# Override "install_lib" command | ||
cmdclass={ | ||
"install_lib": install_lib | ||
}, | ||
|
||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: MacOS', | ||
'Operating System :: POSIX', | ||
'Programming Language :: C', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.6', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.2', | ||
'Programming Language :: Python :: 3.3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Topic :: Software Development', | ||
], | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: MacOS', | ||
'Operating System :: POSIX', | ||
'Programming Language :: C', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Topic :: Software Development', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule hiredis
updated
22 files
+21 −0 | .travis.yml | |
+43 −1 | CHANGELOG.md | |
+11 −15 | Makefile | |
+23 −4 | README.md | |
+12 −12 | adapters/libevent.h | |
+3 −2 | adapters/libuv.h | |
+23 −0 | appveyor.yml | |
+37 −8 | async.c | |
+1 −0 | async.h | |
+2 −2 | dict.c | |
+1 −1 | examples/example.c | |
+4 −13 | fmacros.h | |
+19 −34 | hiredis.c | |
+3 −27 | hiredis.h | |
+42 −23 | net.c | |
+0 −4 | net.h | |
+117 −44 | read.c | |
+4 −9 | read.h | |
+342 −165 | sds.c | |
+184 −16 | sds.h | |
+42 −0 | sdsalloc.h | |
+130 −14 | test.c |