-
Notifications
You must be signed in to change notification settings - Fork 31
/
setup.py
69 lines (57 loc) · 1.74 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
"""
Pinterest Client Package Setup
"""
import os
from datetime import datetime
from pathlib import Path
from setuptools import setup, find_namespace_packages
def _get_test_version():
return datetime.today().strftime('%m%d%Y%H%M%S')
def _get_prod_version():
module = {}
with open(os.path.join(package_root, "pinterest/version.py"), encoding='UTF-8') as fp:
exec(fp.read(), module) # pylint: disable=exec-used
return module.get("__version__")
_IS_TEST_BUILD = os.environ.get("IS_TEST_BUILD", 0)
REQUIRES = [
"urllib3==1.26.12",
"python-dateutil",
"python-dotenv==0.20.0",
"six==1.16.0",
"Pinterest-Generated-Client==0.1.9"
]
long_description = (Path(__file__).parent / "README.md").read_text()
package_root = os.path.abspath(os.path.dirname(__file__))
__version__ = None
if _IS_TEST_BUILD:
print("* Test build enable")
__version__ = _get_test_version()
else:
__version__ = _get_prod_version()
if __version__ is None:
raise ValueError("Version is not defined")
setup(
name="pinterest-api-sdk",
description="Pinterest API SDK",
version=__version__,
author="Pinterest, Inc.",
author_email="[email protected]",
url="https://github.com/pinterest/pinterest-python-sdk",
install_requires=REQUIRES,
include_package_data=True,
packages=find_namespace_packages(
include=['pinterest.*', 'pinterest', 'pinterest.version', 'pinterest.config'],
exclude=[
'sample',
'sample.*',
'tests',
'tests.*',
'integration_tests',
'integration_tests.*',
'.github',
]
),
license='Apache License 2.0',
long_description=long_description,
long_description_content_type='text/markdown',
)