-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
42 lines (37 loc) · 1.08 KB
/
setup.py
File metadata and controls
42 lines (37 loc) · 1.08 KB
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
import os
from subprocess import Popen, PIPE
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
long_description = ""
with open('requirements.txt') as f:
required = f.read().splitlines()
def get_git_version(default="v0.0.1"):
try:
p = Popen(['git', 'describe', '--tags'], stdout=PIPE, stderr=PIPE)
p.stderr.close()
line = p.stdout.readlines()[0]
line = line.strip()
return line.decode('utf-8')
except:
return default
setup(
author="NASA/SAO ADS",
name='adsparser',
classifiers=['Programming Language :: Python :: 2.7'],
description='ADS Parser',
include_package_data=True,
install_requires=required,
license='MIT',
long_description=long_description,
url='https://github.com/adsabs/ADSParser',
packages=find_packages(),
platforms='any',
version=get_git_version(default="v0.0.1"),
zip_safe=False,
)