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

Move pexpect from a runtime dependency to test #2921

Merged
merged 1 commit into from
Oct 29, 2020
Merged

Move pexpect from a runtime dependency to test #2921

merged 1 commit into from
Oct 29, 2020

Conversation

ssbarnea
Copy link
Member

We do not really need pexpect as a runtime dependency as it was using only inside login. Using just subprocess.run() seems to work fine, so we can lower our dependencies.

We do not really need pexpect as a runtime dependency as it was
using only inside login. Using just subprocess.run() seems to
work fine, so we can lower our dependencies.
cmd = "/usr/bin/env {}".format(login_cmd)
self._pt = pexpect.spawn(cmd, dimensions=dimensions)
Copy link
Member Author

Choose a reason for hiding this comment

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

@retr0h Can you please comment on why the pexpect implementation was added in the first place for the interactive login? I am asking because I would not want to introduce a serious regression just because I do not know the reasons behind original implementation.

I did some basic tests and using subprocess.run() appeared to be working fine for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Possible reason from the docs: "The run() function was added in Python 3.5"

If we previously supported < 3.5, then this call wouldn't have been possible.

Copy link
Contributor

@greg-hellings greg-hellings left a comment

Choose a reason for hiding this comment

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

Obviously pending input from @retr0h, but it looks good to me.

cmd = "/usr/bin/env {}".format(login_cmd)
self._pt = pexpect.spawn(cmd, dimensions=dimensions)
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible reason from the docs: "The run() function was added in Python 3.5"

If we previously supported < 3.5, then this call wouldn't have been possible.

@ssbarnea ssbarnea merged commit c36c3b8 into master Oct 29, 2020
@ssbarnea ssbarnea deleted the rm/sh branch October 29, 2020 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants