Skip to content

Commit

Permalink
Makes dev_setup.py script more portable (#2062)
Browse files Browse the repository at this point in the history
* Makes dev_setup.py script more portable

* Removes unused exec_command function
  • Loading branch information
zooba authored and lmazuel committed Feb 28, 2018
1 parent 5ecbcc0 commit 98eae31
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/dev_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))


def exec_command(command):
def pip_command(command):
try:
print('Executing: ' + command)
check_call(command.split(), cwd=root_dir)
check_call([sys.executable, '-m', 'pip'] + command.split(), cwd=root_dir)
print()
except CalledProcessError as err:
print(err, file=sys.stderr)
Expand All @@ -42,24 +42,24 @@ def exec_command(command):
print('Root directory \'{}\'\n'.format(root_dir))

# install general requirements
exec_command('pip install -r requirements.txt')
pip_command('install -r requirements.txt')

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

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

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

# install storage for tests
exec_command('pip install azure-storage')
pip_command('install azure-storage')

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

0 comments on commit 98eae31

Please sign in to comment.