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

build: add python3-pip to ubuntu.Dockerfiles #1679

Merged
merged 3 commits into from
May 27, 2019
Merged

build: add python3-pip to ubuntu.Dockerfiles #1679

merged 3 commits into from
May 27, 2019

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Feb 2, 2019

https://pypi.org/project/tap2junit says that tap2junit is compatible with legacy Python but says nothing about Python 3 compatibility. Related to #1674

@cclauss cclauss changed the title build: add python3-pip to ubuntu1604.Dockerfile.j2 build: add python3-pip to ubuntu.Dockerfiles Feb 2, 2019
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@thefourtheye
Copy link

cc @nodejs/build

@cclauss
Copy link
Contributor Author

cclauss commented Apr 25, 2019

@refack @rvagg @richardlau Is this PR going in the right direction or should I close it?

@rvagg
Copy link
Member

rvagg commented Apr 26, 2019

I have no idea @cclauss, you tell me, what does this even do? What does it mean to have both python-pip and python3-pip and to install tap2junit with both? What will that do when it's invoked by different versions of Node? I can merge this and rebuild the images but I'd be doing it completely blind to the consequences and I don't like having to scramble to fix something that's broken because I didn't understand it.

@cclauss
Copy link
Contributor Author

cclauss commented May 14, 2019

Python 2 and Python 3 have two separate copies of pip. These are usually called pip2 and pip3 but not always so the safe approach is to do python2 -m pip and python3 -m pip to ensure that you are getting the pip that corresponds to the Python that you want to use.

TL;DR They maintain separate "site-packages" directories so that a module like tap2junit needs to be installed into both if we want that module to be accessible to both Py2 and Py3.

On my machine I get:

$ python2 -m pip --version
pip 19.1.1 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)
$ python3 -m pip --version
pip 19.1.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

If I do import tap2junit in a Python 2 script, I will get the module from the first site-package and if I run the exact same code on a Python 3 interpreter, I will get the module from the second.

We will need to have a similar setup on all boxes where we want to test both Pythons.

@rvagg rvagg merged commit d1b1798 into nodejs:master May 27, 2019
@cclauss cclauss deleted the patch-1 branch May 27, 2019 05:09
@rvagg
Copy link
Member

rvagg commented May 27, 2019

should be deployed across all the containers now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants