-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
49 lines (42 loc) · 1.45 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
from setuptools.extension import Extension
try:
from Cython.Distutils import build_ext
cmdclass = {"build_ext": build_ext}
except ImportError:
if os.path.exists("ketama/ketama.c"):
ext = Extension("ketama.ketama", ["contrib/md5.c", "contrib/ketama.c",
"ketama/ketama.c"],
include_dirs=["contrib"])
cmdclass = {}
else:
print("Fatal: Cython is required to compile pyketama")
exit(1)
ext = Extension("ketama.ketama", ["contrib/md5.c", "contrib/ketama.c",
"ketama/ketama.pyx"],
include_dirs=["contrib"])
setup(
name="pyketama",
version="0.2.1",
author="maralla",
author_email="[email protected]",
url="https://github.com/maralla/pyketama",
description="ketama consistent hashing in cython",
long_description=open("README.md").read(),
keywords="python ketama consistent hash cython",
packages=find_packages(),
license="BSD",
zip_safe=False,
cmdclass=cmdclass,
ext_modules=[ext],
classifiers=[
"Topic :: Software Development",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
]
)