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

Support Python 3 when calling pip for extra E2E start up commands #4213

Merged
merged 2 commits into from
Jul 27, 2019

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Jul 26, 2019

Motivation

A few integrations, like ibm_db2

@@ -79,6 +79,9 @@ def agent_command(self):
return get_agent_exe(self.agent_version, platform=self.platform)

def exec_command(self, command, **kwargs):
if command.startswith('pip '):
command = command.replace('pip ', get_pip_exe(self.python_version, self.platform), 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should fix get_pip_exe for MAC, otherwise it won't work for the majority of us.

Copy link
Contributor

@hithwen hithwen Jul 26, 2019

Choose a reason for hiding this comment

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

This exec_command is to run commands in docker not on the local machine

Copy link
Contributor

Choose a reason for hiding this comment

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

Well no this is local environment support.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, sorry, there is another exec_command in docker.py

Copy link
Contributor

@hithwen hithwen Jul 26, 2019

Choose a reason for hiding this comment

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

Yeah, for local environment should it use the tox pip rather than the agent pip? In that case its going to be already the right version or at most replace it with python -m pip

hithwen
hithwen previously approved these changes Jul 26, 2019
@ofek ofek merged commit 9c7466f into master Jul 27, 2019
@ofek ofek deleted the ofek/pip branch July 27, 2019 04:36
@@ -79,6 +79,9 @@ def exec_command(self, command, **kwargs):
if kwargs.pop('interactive', False):
cmd += ' -it'

if command.startswith('pip '):
command = command.replace('pip ', get_pip_exe(self.python_version), 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

how is this working? you cannot replace a string with a list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

command is a string, see line 86

Copy link
Contributor

Choose a reason for hiding this comment

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

but get_pip_exe(self.python_version) returns an array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, thanks! #4225

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.

3 participants