-
Notifications
You must be signed in to change notification settings - Fork 3k
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
A bug fix in the extra-index-url argument for az extension add and update commands. #5491
Conversation
* Update History.rst file. * Added first version of az extension add --extra-index-url test. * Added first version of az extension add --extra-index-url test. * Pep8 fixing * Pep8 fixing. * Pep 8 fix. * Modified the extra-index-url test. Modified the code to give preference to --extra-index-urls * Added some bebug statement. * Hopefully all build problems fixed. * Hopefully all build problems fixed. * Removed prints.
* Resolved PR comments. * Removed unnecessary extra index url precedence logic.
View a preview at https://prompt.ws/r/Azure/azure-cli/5491 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the v. no. changes.
LGTM otherwise.
0.0.10 | ||
++++++ | ||
A bug fix in the --extra-index-url argument in az extension add and update commands. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't released 0.0.9 yet so you can just modify the entry you created prev. for that one.
@@ -14,7 +14,7 @@ | |||
logger.warn("Wheel is not available, disabling bdist_wheel hook") | |||
cmdclass = {} | |||
|
|||
VERSION = "0.0.9" | |||
VERSION = "0.0.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then no need to change the version no.
…date commands. (Azure#5491) * Added the extra-index-urls change to az extension add and update commands. * Bumped the version. * Added --extra-index-url support. Added tests. (Azure#1) * Update History.rst file. * Added first version of az extension add --extra-index-url test. * Added first version of az extension add --extra-index-url test. * Pep8 fixing * Pep8 fixing. * Pep 8 fix. * Modified the extra-index-url test. Modified the code to give preference to --extra-index-urls * Added some bebug statement. * Hopefully all build problems fixed. * Hopefully all build problems fixed. * Removed prints. * Resolved PR comments. (Azure#2) * Removed precedence for extra index urls * Resolved PR comments. * Removed unnecessary extra index url precedence logic. * Updated the version number. * Changed the argument name.
The PR fixes the following bug.
While adding the support for --extra-index-url in az extension add and update commands, I assumed --extra-index-url argument in pip install to be defined using nargs='+'. But that is not the case, it uses action='append'.
So, I changed the pip command accordingly and also modified the tests.
The pip code for extra-index-url is at this link.
https://github.com/pypa/pip/blob/master/src/pip/_internal/cmdoptions.py#L260
A simple code that shows the bug that the PR resolves.
import argparse
parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s [options]')
parser.add_argument('--foo', action='append', help='foo help')
parser.parse_args(['--foo', 'YYY', '--foo', 'abc'])
parser.parse_args(['--foo', 'YYY', 'abc'])
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Command Guidelines
(see Authoring Command Modules)