Mr Piper & Django

🤗

Who's Mr Piper?

Simple project package management

Typical workflow for installing packages

  1. Create a virtual environment
  2. Activate virtual environment
  3. Install dependency `pip install package_name`
  4. Add package_name to requirements.txt
  5. Freeze requirements with `pip freeze > requirements-freeze.txt`

What if... we just did

piper add package_name

What does it do?

piper add package_name

  • Creates the project's virtual environment (if it doesn't exist)
  • Creates requirement files (if they don't exist)
  • Installs package inside virtualenv
  • Automatically adds package to requirement files
  • Automatically generates lock/freeze file

Typical workflow for removing packages

  1. Uninstall package with `pip uninstall package_name`
  2. Remove package_name from requirements.txt
  3. Freeze requirements with `pip freeze > requirements-freeze.txt`

Gotcha!

  1. Delete virtualenv
  2. Create virtualenv
  3. Remove package_name from requirements.txt
  4. Install from requirements.txt
  5. Freeze requirements with `pip freeze > requirements-freeze.txt`

pip uninstall doesn't remove dependencies

What if... we just did

piper remove package_name

What does it do?

piper remove package_name

  • Deducts dependencies that can be safely uninstalled
  • Uninstalls package_name and all safe to delete deps
  • Updates requirements/base.txt and requirements/dev.txt
  • Updates lock files

The API

What does it do?

piper init

Initialises the project

  • Creates virtualenv (default .virtualenvs/project_virtualenv)
  • Creates requirement files
  • Creates .piper file

piper add <package>

piper add --dev <package>

piper remove <package>

piper install

piper install --dev

piper outdated

piper outdated --all

piper upgrade --patch

piper upgrade --latest

piper upgrade --minor

🔥Hot code!🔥

aka a few bugs :)

TODO LIST

  • Python 2 support
  • More tests
  • Pipfile support

https://github.com/jamespacileo/mrpiper

Thank you! :)

Mr Piper & Django

By James Pacileo

Mr Piper & Django

  • 850