Django district pip, virtualenv, virtualenv wrapper & more
Pip, Virtualenv,VirtualenvWrapper & More Django District Wednesday, Nov. 7, 2012 Jackie Kazil @jackiekazil
Where we all start● easy_install Globally● And it works! Yay!● But then.... ○ dependencies or versions ○ coordination w/ other developers ○ keeping different systems on same page ○ breaking sys python
Case study: DependenciesOnce upon a time in city, much like this one,there was a newspaper... ….. over 90 Django applications updated from 0.96 to 1.1.
Case study: Breaking sys pythonFrom stackoverflow..."Is there a way to ensure I can clean everythingup and start from zero?""If you remove everything in these 2 directories,it should clear out all modules...."
Why Pip & Virtualenv● Isolate ○ System packages from project packages ○ Projects from each other● No sudo required - sys python requires sudo access, project python doesn’t
Becoming the standard...Pep 405Python 3.3http://www.python.org/dev/peps/pep-0405"... proposes to add to Python a mechanism forlightweight "virtual environments" with their ownsite directories, optionally isolated from systemsite directories...."
What is...● pip - replaces easy_install● virtualenv - creates isolated python environments● virtualenvwrapper - to be explained later
Where does it live? ~/.virtualenv/foo/...…/bin Binaries in your env. Example: ipython.../include Dev headers used by the #include directive in C.…/lib Where all your python libraries will live lib/python2.7/site-packages.../share Mans & Docs
More... virtualenv-burritohttps://github.com/brainsik/virtualenv-burritoWith one command.... BAM! (or maybe not)... a virtualenv & virtualenvwrapper environment
More... virtualenv-toolshttps://github.com/fireteam/virtualenv-tools"This repository contains scripts wereusing at Fireteam for our deployment ofPython code."
More... Tox http://tox.testrun.org/latest/Tox as is a generic virtualenv management and testcommand line tool you can use for:● checking your package installs correctly with different Python versions and interpreters● running your tests in each of the environments, configuring your test tool of choice● acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell- based testing.
More .... Keeping things freshAutoenvhttps://github.com/kennethreitz/autoenv"Magic per-project shell environments. Very pretentious."Bundle Scouthttp://bundlescout.com/"Daily emails keep you on top of the latest updates fromyour favorite libraries."
More .... Keeping things fresh(cont)Pip Linthttps://github.com/dcramer/piplint"Piplint validates your current environment with therequirements files youve specified."Pip Toolshttps://github.com/nvie/pip-tools"A set of two command line tools to help you keep your pip-based packages fresh, even when youve pinned them"
The EndMe: Jackie Kazil, @jackiekazilW/ contributions from...Chris Adams, @acdha &Members of Django-District :-)http://www.django-district.org/