Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2017 - Fabio Fleitas - Python Package Managemen...

PyBay
August 13, 2017

2017 - Fabio Fleitas - Python Package Management with pip-tools

How to use pip-tools (https://github.com/jazzband/pip-tools) to better manage Python requirement files.

PyBay

August 13, 2017
Tweet

More Decks by PyBay

Other Decks in Programming

Transcript

  1. ISSUE WITH THAT APPROACH IS THAT IT CAN BE NON-DETERMINISTIC

    This is because you did not pin sub-dependencies
  2. ISSUE WITH THAT APPROACH IS THAT YOU NOW HAVE TOP-

    LEVEL DEPENDENCIES MIXED WITH SUB-DEPENDENCIES This will make you life much harder to deal with upgrades/removals of dependencies
  3. CREATE A REQUIREMENTS.IN Only include top-level dependencies # requirements.in django==1.8.18

    djangorestframework==3.5.3 django-extensions==1.7.5 requests==2.18.3
  4. # # This file is autogenerated by pip-compile # To

    update, run: # # pip-compile --output-file requirements.txt requirements.in # certifi==2017.7.27.1 # via requests chardet==3.0.4 # via requests django-extensions==1.7.5 django==1.8.18 djangorestframework==3.5.3 idna==2.5 # via requests requests==2.18.3 six==1.10.0 # via django-extensions urllib3==1.22 # via requests
  5. PIP-SYNC pip-sync ensures that your virtualenv is synced with your

    requirements.txt and removes everything else. This is important so you don't accidentally have other packages in your virtualenv that may have forgotten to be uninstalled.