forked from sec-edgar/sec-edgar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
91 lines (82 loc) · 3.19 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
import os
import re
from setuptools import find_packages, setup
from setuptools.command.install import install
SUPPORTED_VERSIONS = ['3.6', '3.7', '3.8', '3.9']
SUPPORTED_VERSIONS_CLASSIFIERS = ['Programming Language :: Python :: {version}'.format(
version=version) for version in SUPPORTED_VERSIONS]
CLASSIFIERS = [
*SUPPORTED_VERSIONS_CLASSIFIERS,
'Environment :: Console',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
]
with open('README.rst', encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()
HERE = os.path.abspath(os.path.dirname(__file__))
def find_version(*file_paths):
"""Read the version number from a source file.
Why read it, and not import?
see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion
"""
with open(os.path.join(HERE, *file_paths), 'r') as f:
version_file = f.read()
# The version line must have the form __version__ = 'ver'
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def parse_requirements(*files):
required = []
for file in files:
with open(file) as f:
required.append(f.read().splitlines())
return required
setup(
name='secedgar',
version=find_version('secedgar', '__init__.py'),
packages=find_packages(exclude=['docs', 'tests*']),
package_dir={'secedgar': 'secedgar'},
url='https://github.com/sec-edgar/sec-edgar',
download_url='https://github.com/sec-edgar/sec-edgar/releases',
license='Apache License (2.0)',
author='Rahul Ranjan',
author_email='[email protected]',
maintainer='Jack Moody',
maintainer_email='[email protected]',
description="""SEC-Edgar implements a basic crawler for downloading
filings from the SEC Edgar database. It is most useful
for automatically collecting public filings from the SEC.""", # noqa: W291
long_description=LONG_DESCRIPTION,
long_description_content_type='text/x-rst',
entry_points={
'console_scripts': [
'secedgar=secedgar.cli:cli'
]
},
cmdclass={
'install': install,
},
# List run-time dependencies here.
# These will be installed by pip when your
# project is installed.
install_requires=parse_requirements('requirements.txt'),
keywords=['SEC', 'EDGAR', 'crawler', 'filings'],
tests_require=parse_requirements('requirements.txt', 'requirements-dev.txt'),
extras_require={
'cli': [*parse_requirements('requirements.txt'), "Click"]
},
classifiers=CLASSIFIERS,
# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these
# have to be included in MANIFEST.in as well.
package_data={
'secedgar': ['requirements.txt',
'requirements-dev.txt',
'README.rst',
'LICENSE'],
}
)