-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
41 lines (37 loc) · 1.3 KB
/
setup.py
File metadata and controls
41 lines (37 loc) · 1.3 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
# -*- coding: utf-8 -*-
from setuptools import setup
import re
# https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package#7071358
VERSIONFILE = "strategy/_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='strategy',
version=verstr,
description='Trading strategies with python',
long_description=read_md('README.md'),
url='https://github.com/MatthewGilbert/strategy',
author='Matthew Gilbert',
author_email='matthew.gilbert12@gmail.com',
license='MIT',
platforms='any',
install_requires=[
'pandas>=0.18.0',
'numpy',
'mapping',
'pandas_market_calendars>=0.8'
],
packages=['strategy'],
zip_safe=False)