Skip to content

Commit 98eae31

Browse files
zoobalmazuel
authored andcommitted
Makes dev_setup.py script more portable (#2062)
* Makes dev_setup.py script more portable * Removes unused exec_command function
1 parent 5ecbcc0 commit 98eae31

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/dev_setup.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))
1616

1717

18-
def exec_command(command):
18+
def pip_command(command):
1919
try:
2020
print('Executing: ' + command)
21-
check_call(command.split(), cwd=root_dir)
21+
check_call([sys.executable, '-m', 'pip'] + command.split(), cwd=root_dir)
2222
print()
2323
except CalledProcessError as err:
2424
print(err, file=sys.stderr)
@@ -42,24 +42,24 @@ def exec_command(command):
4242
print('Root directory \'{}\'\n'.format(root_dir))
4343

4444
# install general requirements
45-
exec_command('pip install -r requirements.txt')
45+
pip_command('install -r requirements.txt')
4646

4747
# install packages
4848
for package_list in [nspkg_packages, content_packages]:
4949
for package_name in package_list:
50-
exec_command('pip install -e {}'.format(package_name))
50+
pip_command('install -e {}'.format(package_name))
5151

5252
# install test requirements
53-
exec_command('pip install -r azure-sdk-testutils/test-requirements.txt')
53+
pip_command('install -r azure-sdk-testutils/test-requirements.txt')
5454

55-
# isntall packaging requirements
56-
exec_command('pip install -r scripts/packaging_requirements.txt')
55+
# install packaging requirements
56+
pip_command('install -r scripts/packaging_requirements.txt')
5757

5858
# install storage for tests
59-
exec_command('pip install azure-storage')
59+
pip_command('install azure-storage')
6060

6161
# Ensure that the site package's azure/__init__.py has the old style namespace
6262
# package declaration by installing the old namespace package
63-
exec_command('pip install --force-reinstall azure-nspkg==1.0.0')
64-
exec_command('pip install --force-reinstall azure-mgmt-nspkg==1.0.0')
63+
pip_command('install --force-reinstall azure-nspkg==1.0.0')
64+
pip_command('install --force-reinstall azure-mgmt-nspkg==1.0.0')
6565
print('Finished dev setup.')

0 commit comments

Comments
 (0)