-
Notifications
You must be signed in to change notification settings - Fork 121
/
setup.py
90 lines (79 loc) · 3.04 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import os
import sys
from distutils.core import setup, Extension
from glob import glob
# Work-around.
if 'bdist_wheel' in sys.argv:
del setup, Extension
from setuptools import setup, Extension
open_kw = {}
if sys.version_info >= (3,):
open_kw['encoding'] = 'utf-8'
# Read the current version from ephem/__init__.py itself.
path = os.path.join(os.path.dirname(__file__), 'ephem', '__init__.py')
for line in open(path, **open_kw):
if line.startswith('__version__'):
__version__ = eval(line.split(None, 2)[2]) # skip '__version__', '='
# The 'ephem' module is built from every .c file in the libastro
# directory plus ...
libastro_files = glob('libastro/*.c')
libastro_data = glob('extensions/data/*.c')
here = os.path.dirname(__file__)
with open(os.path.join(here, 'README.rst'), **open_kw) as f:
README = f.read()
libraries = []
if os.name != 'nt':
# Linking against library "m" on Windows results in the error:
# LINK : fatal error LNK1181: cannot open input file 'm.lib'
libraries.append('m') # Needed for Android; see GitHub issue #114.
extensions = [
Extension(
'ephem._libastro',
['extensions/_libastro.c', 'extensions/dtoa.c']
+ libastro_files + libastro_data,
extra_compile_args=['-ffloat-store'],
include_dirs=['libastro', '.'],
libraries = libraries,
),
]
setup(name = 'ephem',
version = __version__,
description = 'Compute positions of the planets and stars',
long_description = README,
long_description_content_type = 'text/x-rst',
license = 'MIT',
author = 'Brandon Rhodes',
author_email = '[email protected]',
url = 'http://rhodesmill.org/pyephem/',
project_urls = {
'Source': 'https://github.com/brandon-rhodes/pyephem',
},
classifiers = [
'Development Status :: 6 - Mature',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Topic :: Scientific/Engineering :: Astronomy',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
packages = [ 'ephem', 'ephem.tests' ],
package_data = { 'ephem': ['doc/*.rst',
'tests/jpl/*.txt',
'tests/usno/*.txt',
],},
ext_modules = extensions,
)