forked from amundsen-io/amundsenfrontendlibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
74 lines (60 loc) · 2.14 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
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import subprocess
from setuptools import setup, find_packages
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
PACKAGE_DIR = os.path.join(BASE_DIR, 'amundsen_application', 'static')
def is_npm_installed() -> bool:
try:
subprocess.check_call(['npm --version'], shell=True)
return True
except subprocess.CalledProcessError:
return False
def build_js() -> None:
if not is_npm_installed():
logging.error('npm must be available')
try:
subprocess.check_call(['npm install'], cwd=PACKAGE_DIR, shell=True)
subprocess.check_call(['npm run build'], cwd=PACKAGE_DIR, shell=True)
except Exception as e:
logging.warn('Installation of npm dependencies failed')
logging.warn(str(e))
build_js()
requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')
with open(requirements_path) as requirements_file:
requirements = requirements_file.readlines()
__version__ = '3.7.0'
oicd = ['flaskoidc==0.1.1']
pyarrrow = ['pyarrow==3.0.0']
bigquery_preview = ['google-cloud-bigquery>=2.13.1,<3.0.0', 'flatten-dict==0.3.0']
all_deps = requirements + oicd + pyarrrow + bigquery_preview
setup(
name='amundsen-frontend',
version=__version__,
description='Web UI for Amundsen',
url='https://www.github.com/lyft/amundsenfrontendlibrary',
maintainer='Lyft',
maintainer_email='[email protected]',
packages=find_packages(exclude=['tests*']),
include_package_data=True,
dependency_links=[],
setup_requires=['cython >= 0.29'],
install_requires=requirements,
extras_require={
'oidc': oicd,
'pyarrow': pyarrrow,
'bigquery_preview': bigquery_preview,
'all': all_deps,
},
python_requires=">=3.6",
entry_points="""
[action_log.post_exec.plugin]
logging_action_log=amundsen_application.log.action_log_callback:logging_action_log
""",
classifiers=[
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
)