1+ #!/usr/bin/env python
2+ # -*- coding: utf-8 -*-
13from os .path import join , dirname
24from setuptools import setup
35from setuptools .extension import Extension
46from setuptools .dist import Distribution
57
68try :
79 from cpuinfo import get_cpu_info
8- cpu_info = get_cpu_info ()
9- have_sse42 = 'sse4.2' in cpu_info ['flags' ]
10+ have_sse42 = 'sse4.2' in get_cpu_info ()['flags' ]
1011except Exception :
1112 have_sse42 = False
1213
1516except ImportError :
1617 build_ext = None
1718
18- USE_CYTHON = build_ext is not None
19-
2019
2120class BinaryDistribution (Distribution ):
2221 """
@@ -55,7 +54,8 @@ def is_pure(self):
5554CMDCLASS = {}
5655EXT_MODULES = []
5756
58- if USE_CYTHON :
57+ if build_ext is not None :
58+ CMDCLASS ['build_ext' ] = build_ext
5959 EXT_MODULES .append (
6060 Extension (
6161 "metrohash" ,
@@ -65,7 +65,6 @@ def is_pure(self):
6565 extra_compile_args = CXXFLAGS ,
6666 include_dirs = INCLUDE_DIRS )
6767 )
68- CMDCLASS ['build_ext' ] = build_ext
6968else :
7069 EXT_MODULES .append (
7170 Extension (
@@ -78,7 +77,7 @@ def is_pure(self):
7877 )
7978
8079
81- VERSION = '0.1.0.post3 '
80+ VERSION = '0.1.0.post4 '
8281URL = "https://github.com/escherba/python-metrohash"
8382
8483
@@ -110,7 +109,7 @@ def get_long_description():
110109 ext_modules = EXT_MODULES ,
111110 keywords = ['hash' , 'hashing' , 'metrohash' , 'cityhash' ],
112111 classifiers = [
113- 'Development Status :: 4 - Beta ' ,
112+ 'Development Status :: 5 - Production/Stable ' ,
114113 'Intended Audience :: Developers' ,
115114 'Intended Audience :: Science/Research' ,
116115 'License :: OSI Approved :: Apache Software License' ,
@@ -124,14 +123,12 @@ def get_long_description():
124123 'Programming Language :: Python :: 3.7' ,
125124 'Programming Language :: Python :: 3.8' ,
126125 'Programming Language :: Python :: 3.9' ,
127- 'Topic :: Internet' ,
128- 'Topic :: Scientific/Engineering' ,
129126 'Topic :: Scientific/Engineering :: Information Analysis' ,
130- 'Topic :: Software Development' ,
131- 'Topic :: Software Development :: Libraries :: Python Modules' ,
127+ 'Topic :: Software Development :: Libraries' ,
132128 'Topic :: Utilities'
133129 ],
134130 long_description = get_long_description (),
131+ long_description_content_type = 'text/x-rst' ,
135132 tests_require = ['pytest' ],
136133 distclass = BinaryDistribution ,
137134)
0 commit comments