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
Fix Conan V2 cli broken help #7394
Conversation
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.
Looking good, can be merged.
@@ -81,13 +81,15 @@ def __init__(self, conan_api): | |||
self._commands = {} | |||
conan_commands_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "commands") | |||
for module in pkgutil.iter_modules([conan_commands_path]): | |||
self._add_command("conans.cli.commands.{}".format(module.name), module.name) | |||
module_name = module[1] |
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.
Is this a Py2.7 thing? If that is the case, I am happy with the check you did in the test to run the test only in Py3
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.
This is because in 3.5 they changed the return from a tuple to a named tuple for iter_modules
return value:
https://docs.python.org/3.5/library/pkgutil.html#pkgutil.iter_modules
https://docs.python.org/3.6/library/pkgutil.html#pkgutil.iter_modules
Python2 issue is another one.
from conans.test.utils.tools import TestClient | ||
|
||
|
||
@unittest.skipIf(six.PY2, "v2.0: Only testing for Python 3") |
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.
Probably both the skipIf and the run() method can be put in a common class and all command_v2 tests use it.
Changelog: Fix: Fixing
--help
for commands in proposal for command line v2.0.Docs: omit
Closes: #7366
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.