-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_setup.py
More file actions
38 lines (28 loc) · 1.13 KB
/
dev_setup.py
File metadata and controls
38 lines (28 loc) · 1.13 KB
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
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
"""Prepare development environment
"""
import glob
import os
import sys
from subprocess import check_call, CalledProcessError
COMMON_PKG_NAME = "azure-iot-common"
def pip_command(command, error_ok=False):
try:
print("Executing: " + command)
check_call([sys.executable, "-m", "pip"] + command.split())
print()
except CalledProcessError as err:
print(err)
if not error_ok:
sys.exit(1)
if __name__ == "__main__":
packages = [os.path.dirname(p) for p in glob.glob("azure*/setup.py")]
# Ensure common is installed first
packages.remove(COMMON_PKG_NAME)
packages.insert(0, COMMON_PKG_NAME)
for package_name in packages:
pip_command("install -e {}".format(package_name))
pip_command("install -r requirements.txt")