| 1 |
import os |
| 2 |
import sys |
| 3 |
from distutils.core import setup, Extension |
| 4 |
|
| 5 |
import sgp4 |
| 6 |
description, long_description = sgp4.__doc__.split('\n', 1) |
| 7 |
|
| 8 |
|
| 9 |
optional = True |
| 10 |
if sys.version_info[0] != 2 and os.environ.get('TRAVIS') == 'true': |
| 11 |
optional = False |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
ext_modules = [] |
| 16 |
if sys.version_info[0] == 3: |
| 17 |
ext_modules.append(Extension( |
| 18 |
'sgp4.vallado_cpp', |
| 19 |
optional=optional, |
| 20 |
sources=[ |
| 21 |
'extension/SGP4.cpp', |
| 22 |
'extension/wrapper.cpp', |
| 23 |
], |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
extra_compile_args=['-ffloat-store'], |
| 31 |
)) |
| 32 |
|
| 33 |
|
| 34 |
path = 'sgp4/__init__.py' |
| 35 |
with open(path, 'rb') as f: |
| 36 |
text = f.read().decode('utf-8') |
| 37 |
text = text.replace('-*- coding: utf-8 -*-', '') |
| 38 |
namespace = {} |
| 39 |
eval(compile(text, path, 'exec'), namespace) |
| 40 |
|
| 41 |
setup(name = 'sgp4', |
| 42 |
version = namespace['__version__'], |
| 43 |
description = description, |
| 44 |
long_description = long_description, |
| 45 |
license = 'MIT', |
| 46 |
author = 'Brandon Rhodes', |
| 47 |
author_email = '[email protected]', |
| 48 |
url = 'https://github.com/brandon-rhodes/python-sgp4', |
| 49 |
classifiers = [ |
| 50 |
'Development Status :: 5 - Production/Stable', |
| 51 |
'Intended Audience :: Science/Research', |
| 52 |
'License :: OSI Approved :: MIT License', |
| 53 |
'Programming Language :: Python :: 2', |
| 54 |
'Programming Language :: Python :: 2.6', |
| 55 |
'Programming Language :: Python :: 2.7', |
| 56 |
'Programming Language :: Python :: 3', |
| 57 |
'Programming Language :: Python :: 3.3', |
| 58 |
'Programming Language :: Python :: 3.4', |
| 59 |
'Programming Language :: Python :: 3.5', |
| 60 |
'Programming Language :: Python :: 3.6', |
| 61 |
'Programming Language :: Python :: 3.7', |
| 62 |
'Programming Language :: Python :: 3.8', |
| 63 |
'Programming Language :: Python :: 3.9', |
| 64 |
'Topic :: Scientific/Engineering :: Astronomy', |
| 65 |
], |
| 66 |
packages = ['sgp4'], |
| 67 |
package_data = {'sgp4': ['SGP4-VER.TLE', 'sample*', 'tcppver.out']}, |
| 68 |
ext_modules = ext_modules, |
| 69 |
) |