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

Update pip to latest #144

Closed
2 of 5 tasks
dennisroche opened this issue Dec 12, 2019 · 8 comments
Closed
2 of 5 tasks

Update pip to latest #144

dennisroche opened this issue Dec 12, 2019 · 8 comments
Assignees

Comments

@dennisroche
Copy link

dennisroche commented Dec 12, 2019

Tool information

Virtual environments affected

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Can this tool be installed during the build?

yes, it takes ~5seconds.

but it took me an hour to figure out how to do it.

sudo pip install --upgrade pip

Are you willing to submit a PR?

yes :)

@dennisroche
Copy link
Author

Also after upgrading, seeing this warning.

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

@kaylangan
Copy link
Contributor

I believe we have pip installed on all the images so we'll just need to look at updating the default version. We'll keep Python 2.7 on the image for ~6 months after it EOL's so people have time to move over. @madhurig can someone on your team take a look at this?

@dennisroche
Copy link
Author

Update, it is only the ubuntu images that need to be updated.

@konradpabjan
Copy link
Contributor

I'll take this issue. Working on updating PyPy 2.X on all the images to the latest version so I'll knock this out afterwards.

@kaylangan kaylangan assigned konradpabjan and unassigned madhurig Dec 13, 2019
@brcrista
Copy link

We always update Pip with the latest release of the virtual environment. Though, I don't know off the top of my head when the last update was or when the next one will be.

There will always be some lag when Pip releases a new version, but you're right that it's good practice to make sure you are running with the latest version. That's why the Python workflow templates for Actions have a step to update Pip.

@konradpabjan
Copy link
Contributor

The templates are downloaded here (16.04 example): https://github.com/actions/virtual-environments/blob/7463ea032be0ad4b38dc7a88ebd5375880a53f7f/images/linux/scripts/installers/1604/hosted-tool-cache.sh#L22

There is a file called setup.sh that is downloaded for each version of Python (we build Python ourselves and add it to this toolscache that is then downloaded here), it does this:

PYTHON_MAJOR=python{0}
PYTHON_MAJOR_DOT_MINOR=python{0}.{1}
PYTHON_MAJORMINOR=python{0}{1}

unzip tool.zip
rm tool.zip

ln -s ./bin/$PYTHON_MAJOR_DOT_MINOR python
cd bin/
ln -s $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR
ln -s $PYTHON_MAJOR_DOT_MINOR python

chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR
./python -m ensurepip
./python -m pip install --ignore-installed pip

There must have been a new version of pip since the last image was built and rolled out. This should roll out automatically during the next image update. See the Cadence section in the README. I'll look to add some documentation about pip (not sure yet where, possibly in setup-python) about the behavior of this.

@dennisroche
Copy link
Author

There must have been a new version of pip since the last image was built and rolled out

odd... as i'm seeing pip as significantly out of date when running ubuntu-latest on azure pipelines. see below for repo.

a basic pipeline

trigger: none

pool:
  vmImage: 'ubuntu-latest'

steps:
- script: |
    set -o xtrace
    pip --version
    pip3 --version

when executed, outputs:

+ pip --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
+ pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)

pip 8.1.1 was released on Mar 17, 2016 https://github.com/pypa/pip/releases/tag/8.1.1

@konradpabjan
Copy link
Contributor

That is pip that is part of system Python (we essentially don't maintain any version of Python that is under /usr/lib/*). We recommend you use the setup-python action to use a version of python that is in the tools cache that we actually maintain: https://github.com/actions/setup-python

I have a big doc that is currently in review that explains Python+GitHub along with some of the details around the tools cache. It's going to be added to https://help.github.com/en

Our docs that document the available version of Python mention the setup-python action: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners

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

No branches or pull requests

5 participants