Tool information
pip https://pypi.org/project/pip/Virtual environments affected
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 :)
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
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?
Update, it is only the ubuntu images that need to be updated.
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.
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.
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.
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
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
Most helpful comment
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 thesetup-pythonaction to use a version of python that is in the tools cache that we actually maintain: https://github.com/actions/setup-pythonI 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