forked from Toblerity/rtree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·68 lines (59 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
65
66
67
68
#!/usr/bin/env python
import os
from setuptools import setup
from setuptools.dist import Distribution
from setuptools.command.install import install
import itertools as it
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
class bdist_wheel(_bdist_wheel):
def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False
# Get text from README.txt
with open('docs/source/README.txt', 'r') as fp:
readme_text = fp.read()
# Get __version without importing
with open('rtree/__init__.py', 'r') as fp:
# get and exec just the line which looks like "__version__ = '0.9.4'"
exec(next(line for line in fp if '__version__' in line))
# Tested with wheel v0.29.0
class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform name"""
def has_ext_modules(foo):
return True
class InstallPlatlib(install):
def finalize_options(self):
install.finalize_options(self)
if self.distribution.has_ext_modules():
self.install_lib = self.install_platlib
setup(
name='Rtree',
version=__version__,
description='R-Tree spatial index for Python GIS',
license='MIT',
keywords='gis spatial index r-tree',
author='Sean Gillies',
author_email='[email protected]',
maintainer='Howard Butler',
maintainer_email='[email protected]',
url='https://github.com/Toblerity/rtree',
long_description=readme_text,
packages=['rtree'],
package_data={"rtree": ["lib/*", "include/**/*", "include/**/**/*" ]},
zip_safe=False,
include_package_data = True,
distclass = BinaryDistribution,
cmdclass={'bdist_wheel': bdist_wheel,'install': InstallPlatlib},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: C',
'Programming Language :: C++',
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: GIS',
'Topic :: Database',
],
)