forked from snowflakedb/snowflake-ingest-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
79 lines (66 loc) · 2.38 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
#! /usr/bin/env python3
# We need this to define our package
from setuptools import setup
# We use this to find and deploy our unittests
import unittest
import os
# We need to know the version to backfill some dependencies
from sys import version_info, exit
# Define our list of installation dependencies
DEPENDS = ["pyjwt<2.0.0",
"snowflake-connector-python",
"furl",
"cryptography",
"requests<2.24.0"]
# If we're at version less than 3.4 - fail
if version_info[0] < 3 or version_info[1] < 4:
exit("Unsupported version of Python. Minimum version for the Ingest SDK is 3.4")
# If we're at version 3.4, backfill the typing library
elif version_info[1] == 4:
DEPENDS.append("typing")
# Python 3.5.0 and 3.5.1 have incompatible typing modules. Use typing_extensions instead.
elif version_info[1] == 5 and version_info[2] < 2:
DEPENDS.append("typing_extensions")
here = os.path.abspath(os.path.dirname(__file__))
def test_suite():
"""
Defines the test suite for the snowflake ingest SDK
"""
loader = unittest.TestLoader()
return loader.discover("tests", pattern="test_*.py")
about = {}
with open(os.path.join(here, 'snowflake', 'ingest', 'version.py'),
mode='r', encoding='utf-8') as f:
exec(f.read(), about)
__version__ = about['__version__']
if 'SF_BUILD_NUMBER' in os.environ:
__version__ += ('.' + str(os.environ['SF_BUILD_NUMBER']))
with open(os.path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='snowflake_ingest',
version=__version__,
description='Official SnowflakeDB File Ingest SDK',
long_description=long_description,
author='Snowflake Computing',
author_email='[email protected]',
url='https://www.snowflake.net',
packages=['snowflake.ingest',
'snowflake.ingest.utils'],
license='Apache',
keywords="snowflake ingest sdk copy loading",
package_data={
'snowflake.ingest':['*.rst', 'LICENSE']
},
# From here we describe the package classifiers
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Topic :: Database"
],
# Now we describe the dependencies
install_requires=DEPENDS,
# At last we set the test suite
test_suite="setup.test_suite"
)