-
Notifications
You must be signed in to change notification settings - Fork 67
/
setup.py
37 lines (33 loc) · 1.24 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
# -*- coding: utf-8 -*-
from setuptools import setup
import re
# https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package#7071358
VERSIONFILE = "pdblp/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." %
(VERSIONFILE,))
#http://stackoverflow.com/questions/10718767/have-the-same-readme-both-in-markdown-and-restructuredtext#23265673
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")
read_md = lambda f: open(f, 'r').read()
setup(name='pdblp',
version=verstr,
description='Bloomberg Open API with pandas',
long_description=read_md('README.md'),
url='https://github.com/MatthewGilbert/pdblp',
author='Matthew Gilbert',
author_email='[email protected]',
license='MIT',
platforms='any',
install_requires=['pandas>=0.18.0'],
packages=['pdblp', 'pdblp.tests'],
test_suite='pdblp.tests',
zip_safe=False)