-
Notifications
You must be signed in to change notification settings - Fork 73
/
setup.py
51 lines (41 loc) · 1.34 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
# coding: utf-8
"""
A Python module for NASA's Astrophysical Data Service (ADS) that doesn't suck.
"""
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
major, minor1, minor2, release, serial = sys.version_info
readfile_kwargs = {"encoding": "utf-8"} if major >= 3 else {}
def readfile(filename):
with open(filename, **readfile_kwargs) as fp:
contents = fp.read()
return contents
version_regex = re.compile("__version__ = \"(.*?)\"")
contents = readfile(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"ads", "__init__.py"))
version = version_regex.findall(contents)[0]
setup(name="ads",
version=version,
author="Andrew R. Casey",
author_email="[email protected]",
packages=["ads", "ads.tests", "ads.tests.stubdata"],
url="http://www.github.com/andycasey/ads/",
license="MIT",
description="A Python module for NASA's ADS that doesn't suck.",
long_description=\
readfile(os.path.join(os.path.dirname(__file__), "README.md")),
install_requires=\
readfile(os.path.join(os.path.dirname(__file__), "requirements.txt")),
long_description_content_type="text/markdown",
extras_require={
"tests": [
"httpretty>=0.8.10",
]
}
)