-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.py
executable file
·29 lines (21 loc) · 919 Bytes
/
run.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
#!/usr/bin/env python
if __name__ == '__main__':
import os
import sys
if sys.version_info[0:2] < (3, 12):
raise SystemExit('Python 3.12+ is required')
root_path = os.path.abspath(os.path.dirname(__file__))
try:
import mtp_common
# NB: this version does not need to be updated unless mtp_common changes significantly
if mtp_common.VERSION < (16,):
raise ImportError
except ImportError:
import importlib.metadata
(entry_point,) = importlib.metadata.entry_points(name='pip', group='console_scripts')
pip = entry_point.load()
print('Pre-installing MTP-common and base requirements')
pip(['install', '--requirement', f'{root_path}/requirements/base.txt'])
from mtp_common.build_tasks.executor import Executor
import mtp_api.apps.core.build_tasks # noqa
exit(Executor(root_path=root_path).run())