-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
68 lines (52 loc) · 2.08 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
# ======================================================================================================================
"""
Module to install/set up the SDK.
"""
# ======================================================================================================================
import os
import re
from setuptools import find_packages, setup
# ======================================================================================================================
def load_data(filename: str):
"""
Loads content of a file in memory.
"""
with open(os.path.join(os.path.dirname(__file__), filename), encoding='utf-8') as f:
return f.read()
def extract_version(filename: str):
"""
Extracts the version from the specified Python file.
"""
version_groups = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]", load_data(filename),
re.MULTILINE
)
if version_groups:
return version_groups.group(1)
raise RuntimeError(f"Unable to find version string in file '{filename}'.")
# ======================================================================================================================
setup(
name='amberdata-derivatives',
version=extract_version('amberdata_derivatives/version.py'),
packages=find_packages(exclude='tests'),
description='Python client for Amberdata API for derivatives analytics.',
long_description=load_data('README.md'),
long_description_content_type='text/markdown',
author='Amberdata',
license='Apache License',
url='https://github.com/amberdata/amberdata-derivatives-sdk',
install_requires=[
'deprecation',
'python-dotenv',
'requests'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
],
python_requires='>=3.8',
)
# ======================================================================================================================