Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Update bash-completion #2857

Merged
merged 20 commits into from
Sep 14, 2020
Merged

Update bash-completion #2857

merged 20 commits into from
Sep 14, 2020

Conversation

JunweiSUN
Copy link
Contributor

Update tools/bash-completion, adding new commands and options, resolve previous bugs.
Also update some lines in docs/en_US/Nnictl.md and python version requirements.

@JunweiSUN JunweiSUN marked this pull request as ready for review September 5, 2020 07:44
@@ -15,6 +17,34 @@
else:
raise NotImplementedError('current platform {} not supported'.format(os_type))

class AutoCompletion(install):
def run(self):
COMP_URL = 'https://raw.githubusercontent.com/microsoft/nni/master/tools/bash-completion'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not good to use master branch here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not pack it into python package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will change to a specific release branch.
If we pack it into python package, it is hard to locate the root of the python package, so I choose to directly download it.

@@ -1,38 +1,42 @@
# list of commands/arguments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to automatically generate this file? @liuzhe-lz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can just write the whole file's content to the correct location.

@@ -48,7 +79,7 @@
'nnicli': '../../src/sdk/pycli/nnicli'
},
package_data = {'nni': ['**/requirements.txt']},
python_requires = '>=3.5',
python_requires = '>=3.6',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why upgrade python?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1.8 no longer support python 3.5, see #2778

if os_type == 'Linux':
HOME = os.environ.get('HOME')
if not HOME:
install.run(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is install.run(self) used for here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quiet sure, seems that this line actually do the install action. Every example about how to use cmdclass has this line, like this link

@@ -15,6 +17,35 @@
else:
raise NotImplementedError('current platform {} not supported'.format(os_type))

class AutoCompletion(install):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to remove installation, and update doc to explain how to enable bash completion, or output message after nni installation to tell users to enable bash completion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installation removed. An tutorial documentation has been added.

@JunweiSUN
Copy link
Contributor Author

@QuanluZhang @SparkSnail @scarlett2018 @liuzhe-lz Since this feature will be refactored in v2.0, now I provide a tutorial to guide users how to install bash-completion instead of installing it with pip. Please review again when you have time.

@@ -0,0 +1,39 @@
# Auto Completion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Auto Completion" -> "Auto Completion of nnictl Commands"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@QuanluZhang QuanluZhang self-requested a review September 14, 2020 02:44
@QuanluZhang QuanluZhang merged commit 98a49b1 into microsoft:master Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants