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

Add pack_command to support writing via hiredis-py #147

Merged
merged 21 commits into from
Jan 30, 2023
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add conditional compile flags excluding windows and mac
  • Loading branch information
zalmane committed Jan 25, 2023
commit 8643b7c49bf08757e100c35594b0ea2ec9f8682e
27 changes: 17 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
#!/usr/bin/env python

try:
from setuptools import setup, Extension
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
from distutils.core import setup, Extension
import importlib
import glob
import io
import sys


def version():
loader = importlib.machinery.SourceFileLoader("hiredis.version", "hiredis/version.py")
module = loader.load_module()
return module.__version__
loader = importlib.machinery.SourceFileLoader("hiredis.version", "hiredis/version.py")
module = loader.load_module()
return module.__version__


ext = Extension("hiredis.hiredis",
sources=sorted(glob.glob("src/*.c") +
["vendor/hiredis/%s.c" % src for src in ("alloc", "async", "hiredis", "net", "read", "sds")]),
extra_compile_args=["-std=c99"],
include_dirs=["vendor"])
if 'win' in sys.platform or 'darwin' in sys.platform:
extra_compile_args = []
else:
extra_compile_args = ["-std=c99"]

ext = Extension(
"hiredis.hiredis",
sources=sorted(
glob.glob("src/*.c") +
["vendor/hiredis/%s.c" % src for src in ("alloc", "async", "hiredis", "net", "read", "sds")]),
extra_compile_args=extra_compile_args, include_dirs=["vendor"])

setup(
name="hiredis",
Expand Down