Happy New Year everyone. I look forward to working with you again this year.
Now, on New Year's Day 2014, pip 1.5 was released.
This version has some changes that are incompatible with previous versions. It seems that some people have been responding to this from the beginning of the new year, and thank you for your hard work.
At the moment, the version of pip installed in the Travis CI (https://travis-ci.org/) Python environment is 1.4.1, but upgrading to 1.5 is only a matter of time.
The following procedure is the idea that it would be easier to upgrade first because it will be upgraded anyway.
If you like, you can cut the fix-requrements
branch from the devel
equivalent branch in advance.
pip freeze
to thebefore_script:
entry in .travis.yml
The before_script:
entry is the entry that runs just before the script:
entry where the test body runs.
Add pip freeze
to this entry.
yaml:.travis.yml
before_script:
- "pip freeze"
If requirements.txt
exists, you can write pip freeze -r requirements.txt
to make the output a little easier to see.
However, please note that pip freeze
is different from pip install
, and if you specify multiple files with -r
, only the last specified file will be valid.
.travis.yml
and run the test on Travis CI.The purpose of this is to record the environment when the test passed with the default pip
in the build log, so it is strongly recommended to commit once here.
before_install:
entry in .travis.yml
before_install:
is the entry that runs just before the ʻinstall:entry that does
pip install` etc.
Add the following line to this entry:
yaml:.travis.yml
before_install:
- "easy_install --version"
- "pip freeze"
- "travis_retry pip install -U setuptools"
- "cd `mktemp -d`"
- "travis_retry wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py"
- "travis_retry python get-pip.py"
- "cd $OLDPWD"
- "pip --version"
- "easy_install --version"
The following is a bulleted list.
pip --version
because Travis CI's Python environment prints python and pip versions to the buildlog without any action.pip freeze
doesn't show the version of setuptools, so run ʻeasy_install --version`.pip freeze
is executed before pip install
, so adding the -r
option is meaningless.get-pip.py
instead of pip install
](http://pip.readthedocs.org/en/latest/installing.html# install-or-upgrade-pip) is supposed to be.get-pip.py
.get-pip.py
.get-pip.py
. The body of pip will be downloaded here, so run it with travis_retry
.See the pip Changelog (http://www.pip-installer.org/en/latest/news.html#changelog) for pip changes.
If the test passes successfully, you are done.
With these changes, the latest releases of pip and setuptools (excluding development) are always applied.
At the same time, the list of installed module versions is now in the build log, which should be easier to isolate than looking at the pip install
log when a test fails.
As an aside, it seems that before_script:" bundle show "
is common in Ruby projects, but in Python projects .travis.yml
contains pip freeze
and pip list
. I have never seen a case that I had. (By the way, 0 cases in .travis.yml
of 106 files in 3585 modules that support Python 3.X on PyPI)
Travis CI seems to be a service whose site is built on Ruby, so it may be shunned by Pythonista.