Better Python Package Management

It looks to match the package names up in files matching the following patterns: GLOB_PATTERNS = (u'*requirements.txt', u'requirements[_-]*.txt', u'requirements/*.txt') Ive added a few older packages to my requirements files here: $ cat requirements.txt Django==1.4.16 ansible==1.4.5 requests==2.4.3 $ cat requirements-dev.txt coverage==3.7.1 dopy==0.3.0 peep==1.3 pip-tools==0.3.5 pipdeptree==0.4.1 pycrypto==2.6.1 Ill install them, update them to their latest versions and then save them back into their respective requirements files: $ pip install -r requirements.txt $ pip install -r requirements-dev.txt $ pip-review –auto $ pip-dump Packages that were in requirements.txt and requirements-dev.txt now have their respective latest version numbers: $ cat requirements.txt ansible==1.7.2 Django==1.7.1 ecdsa==0.11 httplib2==0.9 Jinja2==2.7.3 MarkupSafe==0.23 paramiko==1.15.1 PyYAML==3.11 requests==2.4.3 $ cat requirements-dev.txt coverage==3.7.1 dopy==0.3.0 peep==1.3 pip-tools==0.3.5 pipdeptree==0.4.1 pycrypto==2.6.1 Linting your requirements files If you want to find possible issues in your requirements files then piplint can help: $ pip install piplint $ piplint requirements* For debugging purposes, the following packages are installed but not in the requirements file(s): argparse==1.2.1 piplint==0.2.0 wsgiref==0.1.2 Speeding up installations PyPI uses Fastly as a CDN so downloads from them should be reasonably consistent..Thats not to say the installation process cant be sped up..pip-accel will cache source code and binaries compiled during installation so that they wont need to be downloaded/re-compiled if you download the same version again..$ cat requirements.txt pytz==2013.6 $ pip-accel install -r requirements.txt ……..Done!.Took 4.94 seconds to install 1 package..$ pip uninstall pytz ….Successfully uninstalled pytz $ pip-accel install -r requirements.txt ……..Executing command: pip install –download-cache=/home/mark/.pip/download-cache –find-links=file:///home/mark/.pip-accel/sources –build-directory=/tmp/tmpztEZvg –no-index -r requirements.txt –no-install …….. More details

Leave a Reply