-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
113 lines (91 loc) · 3.05 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# -*- coding: utf-8 -*-
#
# you can install this to a local test virtualenv like so:
# virtualenv venv
# ./venv/bin/pip install --editable .
# ./venv/bin/pip install --editable .[dev] # with dev requirements, too
from __future__ import print_function
import os.path
import subprocess
import sys
# For compatibility with Python2.7
from io import open
from setuptools import setup
from mutualfund-stmts-etl import __version__
def generate_readme_rst():
"""
Generate README.rst from README.md via pandoc.
In case of errors, we show a message having the error that we got and
exit the program.
"""
pandoc_cmd = [
'pandoc',
'--from=markdown',
'--to=rst',
'--output=README.rst',
'README.md'
]
if os.path.exists('README.rst'):
return
try:
subprocess.call(pandoc_cmd)
except (IOError, OSError) as e:
print('Could not run "pandoc". Error: %s' % e, file=sys.stderr)
print('Generating only a stub instead of the real documentation.')
def read_file(filename, alt=None):
"""
Read the contents of filename or give an alternative result instead.
"""
lines = None
try:
with open(filename, encoding='utf-8') as f:
lines = f.read()
except IOError:
lines = [] if alt is None else alt
return lines
generate_readme_rst()
long_description = read_file(
'README.rst',
'Generate README.rst from README.md via pandoc!\n\nExample: '
'pandoc --from=markdown --to=rst --output=README.rst README.md'
)
requirements = read_file('requirements.txt')
dev_requirements = read_file('requirements-dev.txt')
trove_classifiers = [
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Financial and Insurance Industry',
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python',
'Topic :: Office/Business :: Financial',
'Topic :: Office/Business :: Financial :: Investment',
]
setup(
name='mutualfund-stmts-etl',
version=__version__,
maintainer='Harjeet Singh',
maintainer_email='harjeetss@gmail.com',
license='LGPL',
url='https://github.com/jethar/mutualfund-stmts-etl',
install_requires=requirements,
extras_require=dict(
dev=dev_requirements
),
description='Script for colating information from finnacial statements.',
long_description=long_description,
keywords=['mutualfund-stmts-etl', 'nse',
'download', 'capital-gains', 'portfolio-stmts', 'mutual-funds'],
classifiers=trove_classifiers,
packages=["mutualfund-stmts-etl"],
entry_points=dict(
console_scripts=[
'mutualfund-stmts-etl=mutualfund-stmts-etl.extract:main'
]
),
platforms=['any'],
)