forked from hajimes/mmh3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
64 lines (56 loc) · 2.15 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# MurmurHash3 was written by Austin Appleby, and is placed in the public domain.
# mmh3 Python module was written by Hajime Senuma, and is also placed in the public domain.
# The authors hereby disclaim copyright to these source codes.
import platform
import sys
from setuptools import Extension, setup
COMPILE_OPTIONS = []
LINK_OPTIONS = []
def is_new_osx():
"""Check whether we're on OSX >= 10.7"""
if sys.platform != "darwin":
return False
mac_ver = platform.mac_ver()[0]
if mac_ver.startswith("10"):
minor_version = int(mac_ver.split(".")[1])
return minor_version >= 7
return False
if is_new_osx():
# On Mac, use libc++ because Apple deprecated use of
# libstdc
COMPILE_OPTIONS.append("-stdlib=libc++")
LINK_OPTIONS.append("-lc++")
# g++ (used by unix compiler on mac) links to libstdc++ as a default lib.
# See: https://stackoverflow.com/questions/1653047/avoid-linking-to-libstdc
LINK_OPTIONS.append("-nodefaultlibs")
mmh3module = Extension(
"mmh3",
sources=["mmh3module.cpp", "MurmurHash3.cpp"],
extra_compile_args=COMPILE_OPTIONS,
extra_link_args=LINK_OPTIONS,
)
setup(
name="mmh3",
version="3.0.0",
description="Python wrapper for MurmurHash (MurmurHash3), a set of fast and robust hash functions.",
license="License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
author="Hajime Senuma",
author_email="[email protected]",
url="https://github.com/hajimes/mmh3",
ext_modules=[mmh3module],
keywords="utility hash MurmurHash",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
],
)