Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py3 import package from pypi support for multiple module names #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Utility/Python/import_py3package_from_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
subscription_id (-s) - Subscription id of the Automation account
resource_group (-g) - Resource group name of the Automation account
automation_account (-a) - Automation account name
module_name (-m) - Name of module to import from pypi.org
module_name (-m) - Name of module to import from pypi.org (supports comma separated list of names)
Imports module
Example:
import_python3package_from_pypi.py -s xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx -g contosogroup -a contosoaccount -m pytz
Expand Down Expand Up @@ -102,7 +102,7 @@ def import_package_with_dependencies (packagename):

if __name__ == '__main__':
if len(sys.argv) < 9:
raise Exception("Requires Subscription id -s, Automation resource group name -g, account name -a, and module name -g as arguments. \
raise Exception("Requires Subscription id -s, Automation resource group name -g, account name -a, and module name -m as arguments. \
Example: -s xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx -g contosogroup -a contosoaccount -m pytz ")

# Process any arguments sent in
Expand All @@ -126,5 +126,6 @@ def import_package_with_dependencies (packagename):
token = get_automation_runas_token()

# Import package with dependencies from pypi.org
import_package_with_dependencies(module_name)
for module_name in module_name.split(','):
import_package_with_dependencies(module_name)
print ("\nCheck the python 3 packages page for import status...")