SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
Arbeiten mit distribute,
  pip und virtualenv
         Markus Zapke-Gründemann
  11. DZUG-Tagung zu Zope, Plone und Python
Markus
    Zapke-Gründemann
•   Softwareentwickler seit 2001

•   Schwerpunkt: Web Application Development
    mit Python und PHP

•   Django, symfony & Zend Framework

•   Freier Softwareentwickler und Berater
    seit 2008

•   www.keimlink.de
Überblick
•   Vorstellung der Werkzeuge   •   Einsatz in der Praxis

    •   distribute                  •   modern-package-
                                        template
    •   distutils2
                                    •   virtualenv
    •   pip
                                    •   virtualenvwrapper
    •   virtualenv
                                    •   pip
    •   virtualenvwrapper
Vorstellung der
  Werkzeuge
Python Packaging




Quelle: http://guide.python-distribute.org/introduction.html#current-state-of-packaging
distribute

•   Fork des setuptools Pakets

•   Erweitert distutils

•   Stellt setuptools für Pakete zur Verfügung,
    die davon abhängen

•   Python 3 Unterstützung

•   Maintainer: Tarek Ziadé
distribute installieren

$ wget http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py



 1. Entfernen der bestehenden setuptools Installation
 2. Installieren einer Fake setuptools Installation
 3. Installation von distribute
distutils2
•   Tarek Ziadé: „A toolbox for third packaging
    tools“

•   PEP 345: Metadata for Python Software
    Packages 1.2

•   PEP 376: Database of Installed Python
    Distributions

•   PEP 386: Changing the version comparison
    module in Distutils
pip
•   „pip installs packages“     •   Protokollieren der Aktionen

•   Ersatz für easy_install     •   Kann einen URL oder ein
                                    VCS als Quelle benutzen
•   Kann Pakete wieder
    deinstallieren              •   „requirements“

•   Nur vollständige            •   Unterstüzung für
    Installationen werden           virtualenv
    durchgeführt
                                •   Autor: Ian Bicking
•   „Sinnvolle“ Ausgaben


                $ easy_install pip
Design done by Idan Gazit (http://pixane.com) - License: cc-by-3.0
virtualenv

•   Isolierte Python Umgebungen

•   Unterstützung für distribute

•   Kann mit WSGI Containern benutzt werden

•   Autor: Ian Bicking


        $ pip install virtualenv
virtualenv: Isolierte
    Python Umgebungen

•   Python Version wählbar (zum Teil als Symlink)

•   Eigenes bin Verzeichnis

•   Eigenes site-packages Verzeichnis
virtualenv: Struktur
testenv/
|-- bin
|   |-- activate
|   |-- activate_this.py
|   |-- easy_install
|   |-- easy_install-2.6
|   |-- pip
|   |-- python
|   `-- python2.6 -> python
|-- include
|   `-- python2.6 -> /PREFIX/include/python2.6
`-- lib
    `-- python2.6
         |-- UserDict.py -> /PREFIX/lib/python2.6/UserDict.py
         |-- ...
         |-- distutils
         |-- ...
         |-- orig-prefix.txt
         |-- ...
         |-- site-packages
         |-- site.py
         |-- ...
         `-- warnings.py -> /PREFIX/lib/python2.6/warnings.py
virtualenvwrapper
    •   Erweiterung für virtualenv

    •   Erleichtern das Erstellen, Löschen und
        Management der virtualenvs

    •   Autor: Doug Hellmann

$   pip install virtualenvwrapper
$   mkdir ~/.virtualenvs
$   export WORKON_HOME=$HOME/.virtualenvs
$   source /usr/local/bin/virtualenvwrapper.sh
Einsatz in der Praxis
modern-package-template
modern-package-template

 •   PasteScript Template

     •   distribute

     •   buildout

 •   Autor: Sridhar Ratnakumar


$ pip install modern-package-template
modern-package-template
$ paster create -t modern_package testpackage
Selected and implied templates:
  modern-package-template#modern_package Package with distribute and buildout support

Variables:
  egg:      testpackage
  package: testpackage
  project: testpackage
Enter version (Version (like 0.1)) ['0.1']:
Enter description (One-line description of the package) ['']: A test package.
Enter keywords (Space-separated keywords/tags) ['']: test package
Enter author (Author name) ['']: Markus Zapke-Gründemann
Enter author_email (Author email) ['']: info@keimlink.de
Enter url (URL of homepage) ['']: http://www.keimlink.de/
Enter license_name (License name) ['']: BSD
Creating template modern_package
Creating directory ./testpackage
  Copying HACKING.txt to ./testpackage/HACKING.txt
  Copying MANIFEST.in to ./testpackage/MANIFEST.in
  Copying NEWS.txt to ./testpackage/NEWS.txt
  Copying README.rst to ./testpackage/README.rst
  Copying bootstrap.py to ./testpackage/bootstrap.py
  Copying buildout.cfg_tmpl to ./testpackage/buildout.cfg
  Copying setup.py_tmpl to ./testpackage/setup.py
Running /usr/bin/python setup.py egg_info
modern-package-template
  Verzeichnisstruktur
   testpackage/
   |-- .gitignore
   |-- .hgignore
   |-- HACKING.txt
   |-- MANIFEST.in
   |-- NEWS.txt
                             buildout
   |-- README.rst
   |-- bootstrap.py          distribute
   |-- buildout.cfg
   |-- setup.py
   `-- src
       |-- testpackage
       `-- testpackage.egg-info
virtualenv
virtualenv anlegen

zappi ~$ virtualenv testenv
New python executable in testenv/bin/python
Installing setuptools............done.

zappi ~$ virtualenv --distribute testenv
New python executable in testenv/bin/python
Installing distribute................................................
.....................................................................
............................................................done.




          $ export VIRTUALENV_USE_DISTRIBUTE=1
virtualenv aktivieren
             und deaktivieren

zappi ~/$ cd testenv
zappi ~/testenv$ . bin/activate
(testenv)zappi ~/testenv$ deactivate
zappi ~/testenv$
virtualenvwrapper
mkvirtualenv
zappi ~$ mkvirtualenv testenv
New python executable in testenv/bin/python
Installing setuptools............done.
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/predeactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/postdeactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/preactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/postactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/get_env_details
(testenv)zappi ~$
mkvirtualenv
zappi ~$ mkvirtualenv --no-site-packages --distribute testenv
New python executable in testenv/bin/python
Installing distribute................................................
.....................................................................
............................................................done.
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/predeactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/postdeactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/preactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/postactivate
virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/
testenv/bin/get_env_details
(testenv)zappi ~$
cdvirtualenv


(testenv)zappi ~$ cdvirtualenv
(testenv)zappi ~/.virtualenvs/testenv$
lssitepackages

(testenv)zappi ~$ lssitepackages
distribute-0.6.10-py2.6.egg easy-install.pth       pip-0.7.1-py2.6.egg
setuptools.pth

(testenv)zappi ~$ lssitepackages -l
total 8
drwxr-xr-x 10 zappi zappi 340 Aug 10   19:22   distribute-0.6.10-py2.6.egg
-rw-r--r-- 1 zappi zappi 237 Aug 10    19:22   easy-install.pth
drwxr-xr-x 4 zappi zappi 136 Aug 10    19:22   pip-0.7.1-py2.6.egg
-rw-r--r-- 1 zappi zappi 30 Aug 10     19:22   setuptools.pth
cdsitepackages

(testenv)zappi ~$ cdsitepackages
(testenv)zappi ~/.virtualenvs/testenv/lib/python2.6/site-packages$ ls -l
total 8
drwxr-xr-x 10 zappi zappi 340 Aug 10 19:22 distribute-0.6.10-py2.6.egg
-rw-r--r-- 1 zappi zappi 237 Aug 10 19:22 easy-install.pth
drwxr-xr-x 4 zappi zappi 136 Aug 10 19:22 pip-0.7.1-py2.6.egg
-rw-r--r-- 1 zappi zappi 30 Aug 10 19:22 setuptools.pth
add2virtualenv

(testenv)zappi ~/Projekte/Python$ add2virtualenv django-dev
Warning: Converting "django-dev" to "/Users/zappi/Projekte/Python/django-dev"
(testenv)zappi ~/Projekte/Python$ lssitepackages
distribute-0.6.10-py2.6.egg easy-install.pth pip-0.7.1-py2.6.egg
setuptools.pth virtualenv_path_extensions.pth

virtualenv_path_extensions.pth:
/Users/zappi/Projekte/Python/django-dev
deactivate


(testenv)zappi ~$ deactivate
zappi ~$
workon


zappi ~$ workon testenv
(testenv)zappi ~$
rmvirtualenv


(testenv)zappi ~$ rmvirtualenv testenv
ERROR: You cannot remove the active environment ('testenv').
Either switch to another environment, or run 'deactivate'.
(testenv)zappi ~$ deactivate
zappi ~$ rmvirtualenv testenv
Hooks
~/.virtualenvs/testenv/bin/
|-- get_env_details
|-- postactivate
|-- postdeactivate
|-- preactivate
`-- predeactivate

~/.virtualenvs/
|-- get_env_details
|-- initialize
|-- postactivate
|-- postdeactivate
|-- postmkvirtualenv
|-- postrmvirtualenv
|-- preactivate
|-- predeactivate
|-- premkvirtualenv
`-- prermvirtualenv
pip
pip install
$ pip install Markdown
Downloading/unpacking Markdown
  Downloading Markdown-2.0.3.zip (94Kb): 94Kb downloaded
  Running setup.py egg_info for package Markdown
Installing collected packages: Markdown
  Running setup.py install for Markdown
    changing mode of build/scripts-2.6/markdown from 644 to 755
    changing mode of /Users/zappi/.virtualenvs/testenv/bin/markdown
to 755
Successfully installed Markdown
Cleaning up...
pip install
$ pip install Django==1.1.2

$ pip install http://effbot.org/downloads/Imaging-1.1.6.tar.gz

$ pip install -e svn+http://svn.myproject.org/svn/MyProject/
trunk#egg=MyProject

$ pip install -e svn+http://svn.myproject.org/svn/MyProject/
trunk@2019#egg=MyProject

$ pip install --upgrade celery
pip install
$ cat requirements.txt
Django==1.1.2
nose==0.11
-e svn+http://mycompany/svn/MyApp/trunk@1045#egg=MyApp
-e svn+http://mycompany/svn/MyLibrary/trunk@1058#egg=MyLibrary

$ pip install -r requirements.txt
Downloading/unpacking nose==0.11 (from -r requirements.txt (line 2))
  Downloading nose-0.11.0.tar.gz (249Kb): 249Kb downloaded
  Running setup.py egg_info for package nose
    no previously-included directories found matching 'doc/.build'
Downloading/unpacking Django==1.1.2 (from -r requirements.txt (line 1))
  Downloading Django-1.1.2.tar.gz (5.7Mb): 5.7Mb downloaded
  Running setup.py egg_info for package Django
Installing collected packages: Django, nose
  Running setup.py install for Django
    changing mode of build/scripts-2.6/django-admin.py from 644 to 755
    changing mode of /Users/zappi/.virtualenvs/devenv/bin/django-admin.py to 755
  Running setup.py install for nose
    no previously-included directories found matching 'doc/.build'
    Installing nosetests-2.6 script to /Users/zappi/.virtualenvs/devenv/bin
    Installing nosetests script to /Users/zappi/.virtualenvs/devenv/bin
Successfully installed Django nose
Cleaning up...
pip install
$ pip install -E ~/.virtualenvs/devenv -r requirements.txt
Downloading/unpacking nose==0.11 (from -r requirements.txt (line 2))
  Downloading nose-0.11.0.tar.gz (249Kb): 249Kb downloaded
  Running setup.py egg_info for package nose
    no previously-included directories found matching 'doc/.build'
Downloading/unpacking Django==1.1.2 (from -r requirements.txt (line 1))
  Downloading Django-1.1.2.tar.gz (5.7Mb): 5.7Mb downloaded
  Running setup.py egg_info for package Django
Installing collected packages: Django, nose
  Found existing installation: Django 1.1.1
    Not uninstalling Django at /Library/Python/2.6/site-packages, outside environment /
Users/zappi/.virtualenvs/devenv/bin/..
  Running setup.py install for Django
    changing mode of build/scripts-2.6/django-admin.py from 644 to 755
    changing mode of /Users/zappi/.virtualenvs/devenv/bin/django-admin.py to 755
  Found existing installation: nose 0.11.1
    Not uninstalling nose at /Library/Python/2.6/site-packages, outside environment /
Users/zappi/.virtualenvs/devenv/bin/..
  Running setup.py install for nose
    no previously-included directories found matching 'doc/.build'
    Installing nosetests-2.6 script to /Users/zappi/.virtualenvs/devenv/bin
    Installing nosetests script to /Users/zappi/.virtualenvs/devenv/bin
Successfully installed Django nose
Cleaning up...
pip install
$ pip install anyjson boo
Downloading/unpacking anyjson
  Downloading anyjson-0.2.4.tar.gz
  Running setup.py egg_info for package anyjson
Downloading/unpacking boo
  Could not find any downloads that satisfy the requirement boo
No distributions at all found for boo
Storing complete log in /Users/zappi/.pip/pip.log
pip uninstall
$ pip uninstall Markdown
Uninstalling Markdown:
  /Users/zappi/.virtualenvs/testenv/bin/markdown
  /Users/zappi/.virtualenvs/testenv/lib/python2.6/site-packages/
Markdown-2.0.3-py2.6.egg-info
  /Users/zappi/.virtualenvs/testenv/lib/python2.6/site-packages/
markdown
Proceed (y/n)? y
  Successfully uninstalled Markdown
pip & PyPI Mirrors

PEP 381: Mirroring infrastructure for PyPI

$ pip install --use-mirrors Django

                   oder

$ export PIP_USE_MIRRORS=true
pip freeze
$ pip freeze
Django==1.2.1
amqplib==0.6.1
anyjson==0.2.4
billiard==0.3.1
carrot==0.10.5
celery==1.0.5
distribute==0.6.10
django-debug-toolbar==0.8.3
django-picklefield==0.1.6
importlib==1.0.2
python-dateutil==1.5
wsgiref==0.1.2

$ pip freeze > requirements.txt
pip search
$ pip search markdown
Markdoc                   - A lightweight Markdown-based wiki build tool.
markdown2                 - markdown2: A fast and complete Python implementaion of
                            Markdown.
Argot                     - argot text markup -- a markdown dialect
Flask-Markdown            - Small extension to make using markdown easy
Markdown                  - Python implementation of Markdown.
  INSTALLED: 2.0.3 (latest)
django-markdown2          - This is a simple app, which supplies a single template tag
                            for markdown markup.
tiddlywebplugins.markdown - Markdown rendering for TiddlyWeb
discount                  - A Python interface for Discount, the C Markdown parser
tiddlywebplugins.simplewiki - A simple markdown based wiki in TiddlyWeb
django-markdown-deux      - a Django app that provides template tags for using Markdown
                            (using the python-markdown2 processor)
pymarkdown_minisite       - Parse a list of markdown files to a website with index.
html2text                 - Turn HTML into equivalent Markdown-structured text.
markdown2latex            - Extension
django-autolinks          - App for storing links and automatic link extraction from
                            markdown texts.
collective.transform.multimarkdown - MultiMarkdown text transform for Plone
pip completion

$ pip completion --bash >> ~/.profile

$ pip completion --zsh >> ~/.zprofile
Links
•   http://pypi.python.org/pypi/distribute

•   http://guide.python-distribute.org/

•   http://pip.openplans.org/

•   http://pypi.python.org/pypi/virtualenv

•   http://pypi.python.org/pypi/virtualenvwrapper

•   http://pypi.python.org/pypi/modern-package-
    template
Lizenz

       Dieses Werk ist unter einem Creative Commons
Namensnennung-Weitergabe unter gleichen Bedingungen 3.0
               Unported Lizenzvertrag lizenziert.
         Um die Lizenz anzusehen, gehen Sie bitte zu
http://creativecommons.org/licenses/by-sa/3.0/ oder schicken
  Sie einen Brief an Creative Commons, 171 Second Street,
        Suite 300, San Francisco, California 94105, USA.

Mais conteúdo relacionado

Mais procurados

Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOpsAgile Spain
 
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기raccoony
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopWalter Heck
 
Scripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionScripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionEduardo Pelegri-Llopart
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Soshi Nemoto
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetWalter Heck
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeSoshi Nemoto
 
rake puppetexpert:create - Puppet Camp Silicon Valley 2014
rake puppetexpert:create - Puppet Camp Silicon Valley 2014rake puppetexpert:create - Puppet Camp Silicon Valley 2014
rake puppetexpert:create - Puppet Camp Silicon Valley 2014nvpuppet
 
Do you know all of Puppet?
Do you know all of Puppet?Do you know all of Puppet?
Do you know all of Puppet?Julien Pivotto
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with dockerGiacomo Bagnoli
 
Puppet DSL: back to the basics
Puppet DSL: back to the basicsPuppet DSL: back to the basics
Puppet DSL: back to the basicsJulien Pivotto
 
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Puppet
 
How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wikishahab071
 

Mais procurados (20)

Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOps
 
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
 
Scripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionScripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full Version
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
Puppet evolutions
Puppet evolutionsPuppet evolutions
Puppet evolutions
 
Puppet modules for Fun and Profit
Puppet modules for Fun and ProfitPuppet modules for Fun and Profit
Puppet modules for Fun and Profit
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
rake puppetexpert:create - Puppet Camp Silicon Valley 2014
rake puppetexpert:create - Puppet Camp Silicon Valley 2014rake puppetexpert:create - Puppet Camp Silicon Valley 2014
rake puppetexpert:create - Puppet Camp Silicon Valley 2014
 
Do you know all of Puppet?
Do you know all of Puppet?Do you know all of Puppet?
Do you know all of Puppet?
 
F3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project LifecycleF3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project Lifecycle
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Puppet DSL: back to the basics
Puppet DSL: back to the basicsPuppet DSL: back to the basics
Puppet DSL: back to the basics
 
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
 
How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wiki
 

Destaque

Celery - eine asynchrone Task Queue (nicht nur) für Django
Celery - eine asynchrone Task Queue (nicht nur) für DjangoCelery - eine asynchrone Task Queue (nicht nur) für Django
Celery - eine asynchrone Task Queue (nicht nur) für DjangoMarkus Zapke-Gründemann
 
Sichere Web-Applikationen am Beispiel von Django
Sichere Web-Applikationen am Beispiel von DjangoSichere Web-Applikationen am Beispiel von Django
Sichere Web-Applikationen am Beispiel von DjangoMarkus Zapke-Gründemann
 
Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using SphinxMarkus Zapke-Gründemann
 
Django - The Web framework for perfectionists with deadlines
Django - The Web framework for perfectionists with deadlinesDjango - The Web framework for perfectionists with deadlines
Django - The Web framework for perfectionists with deadlinesMarkus Zapke-Gründemann
 
Distributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialDistributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialTed Naleid
 
Virtuelle Maschinen mit Packer, Vagrant und Salt bauen
Virtuelle Maschinen mit Packer, Vagrant und Salt bauenVirtuelle Maschinen mit Packer, Vagrant und Salt bauen
Virtuelle Maschinen mit Packer, Vagrant und Salt bauenMarkus Zapke-Gründemann
 

Destaque (7)

Celery - eine asynchrone Task Queue (nicht nur) für Django
Celery - eine asynchrone Task Queue (nicht nur) für DjangoCelery - eine asynchrone Task Queue (nicht nur) für Django
Celery - eine asynchrone Task Queue (nicht nur) für Django
 
Sichere Web-Applikationen am Beispiel von Django
Sichere Web-Applikationen am Beispiel von DjangoSichere Web-Applikationen am Beispiel von Django
Sichere Web-Applikationen am Beispiel von Django
 
Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using Sphinx
 
Mercurial
MercurialMercurial
Mercurial
 
Django - The Web framework for perfectionists with deadlines
Django - The Web framework for perfectionists with deadlinesDjango - The Web framework for perfectionists with deadlines
Django - The Web framework for perfectionists with deadlines
 
Distributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialDistributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With Mercurial
 
Virtuelle Maschinen mit Packer, Vagrant und Salt bauen
Virtuelle Maschinen mit Packer, Vagrant und Salt bauenVirtuelle Maschinen mit Packer, Vagrant und Salt bauen
Virtuelle Maschinen mit Packer, Vagrant und Salt bauen
 

Semelhante a Arbeiten mit distribute, pip und virtualenv

5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenvamenasse
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & moreJacqueline Kazil
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Codemotion
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolutionTatiana Al-Chueyr
 
Great Hiroshima with Python 170830
Great Hiroshima with Python 170830Great Hiroshima with Python 170830
Great Hiroshima with Python 170830Takuya Nishimoto
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideRapidValue
 
First python project
First python projectFirst python project
First python projectNeetu Jain
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012Carlos Sanchez
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modulesKris Buytaert
 
Isolated development in python
Isolated development in pythonIsolated development in python
Isolated development in pythonAndrés J. Díaz
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionFabio Kung
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chefLeanDog
 
Packaging in packaging: dh-virtualenv
Packaging in packaging: dh-virtualenvPackaging in packaging: dh-virtualenv
Packaging in packaging: dh-virtualenvJyrki Pulliainen
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk GötzNETWAYS
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012Carlos Sanchez
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Patrick Muehlbauer
 
Installing OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xInstalling OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xNader Karimi
 

Semelhante a Arbeiten mit distribute, pip und virtualenv (20)

5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenv
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & more
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolution
 
Great Hiroshima with Python 170830
Great Hiroshima with Python 170830Great Hiroshima with Python 170830
Great Hiroshima with Python 170830
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
 
Python+gradle
Python+gradlePython+gradle
Python+gradle
 
First python project
First python projectFirst python project
First python project
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Isolated development in python
Isolated development in pythonIsolated development in python
Isolated development in python
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
Python Projects at Neova
Python Projects at NeovaPython Projects at Neova
Python Projects at Neova
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
Packaging in packaging: dh-virtualenv
Packaging in packaging: dh-virtualenvPackaging in packaging: dh-virtualenv
Packaging in packaging: dh-virtualenv
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018
 
Installing OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xInstalling OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.x
 

Mais de Markus Zapke-Gründemann

Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using SphinxMarkus Zapke-Gründemann
 
Celery eine asynchrone task queue (nicht nur) für django
Celery   eine asynchrone task queue (nicht nur) für djangoCelery   eine asynchrone task queue (nicht nur) für django
Celery eine asynchrone task queue (nicht nur) für djangoMarkus Zapke-Gründemann
 
Bottle - Python Web Microframework (english)
Bottle - Python Web Microframework (english)Bottle - Python Web Microframework (english)
Bottle - Python Web Microframework (english)Markus Zapke-Gründemann
 
Django - The Web framework for perfectionists with deadlines
Django - The Web framework  for perfectionists with deadlinesDjango - The Web framework  for perfectionists with deadlines
Django - The Web framework for perfectionists with deadlinesMarkus Zapke-Gründemann
 

Mais de Markus Zapke-Gründemann (6)

Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using Sphinx
 
Celery eine asynchrone task queue (nicht nur) für django
Celery   eine asynchrone task queue (nicht nur) für djangoCelery   eine asynchrone task queue (nicht nur) für django
Celery eine asynchrone task queue (nicht nur) für django
 
Bottle - Python Web Microframework (english)
Bottle - Python Web Microframework (english)Bottle - Python Web Microframework (english)
Bottle - Python Web Microframework (english)
 
EuroDjangoCon 2009 - Ein Rückblick
EuroDjangoCon 2009 - Ein RückblickEuroDjangoCon 2009 - Ein Rückblick
EuroDjangoCon 2009 - Ein Rückblick
 
Bottle - Python Web Microframework
Bottle - Python Web MicroframeworkBottle - Python Web Microframework
Bottle - Python Web Microframework
 
Django - The Web framework for perfectionists with deadlines
Django - The Web framework  for perfectionists with deadlinesDjango - The Web framework  for perfectionists with deadlines
Django - The Web framework for perfectionists with deadlines
 

Último

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 

Último (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Arbeiten mit distribute, pip und virtualenv

  • 1. Arbeiten mit distribute, pip und virtualenv Markus Zapke-Gründemann 11. DZUG-Tagung zu Zope, Plone und Python
  • 2. Markus Zapke-Gründemann • Softwareentwickler seit 2001 • Schwerpunkt: Web Application Development mit Python und PHP • Django, symfony & Zend Framework • Freier Softwareentwickler und Berater seit 2008 • www.keimlink.de
  • 3. Überblick • Vorstellung der Werkzeuge • Einsatz in der Praxis • distribute • modern-package- template • distutils2 • virtualenv • pip • virtualenvwrapper • virtualenv • pip • virtualenvwrapper
  • 4. Vorstellung der Werkzeuge
  • 6.
  • 7. distribute • Fork des setuptools Pakets • Erweitert distutils • Stellt setuptools für Pakete zur Verfügung, die davon abhängen • Python 3 Unterstützung • Maintainer: Tarek Ziadé
  • 8. distribute installieren $ wget http://python-distribute.org/distribute_setup.py $ python distribute_setup.py 1. Entfernen der bestehenden setuptools Installation 2. Installieren einer Fake setuptools Installation 3. Installation von distribute
  • 9. distutils2 • Tarek Ziadé: „A toolbox for third packaging tools“ • PEP 345: Metadata for Python Software Packages 1.2 • PEP 376: Database of Installed Python Distributions • PEP 386: Changing the version comparison module in Distutils
  • 10. pip • „pip installs packages“ • Protokollieren der Aktionen • Ersatz für easy_install • Kann einen URL oder ein VCS als Quelle benutzen • Kann Pakete wieder deinstallieren • „requirements“ • Nur vollständige • Unterstüzung für Installationen werden virtualenv durchgeführt • Autor: Ian Bicking • „Sinnvolle“ Ausgaben $ easy_install pip
  • 11. Design done by Idan Gazit (http://pixane.com) - License: cc-by-3.0
  • 12. virtualenv • Isolierte Python Umgebungen • Unterstützung für distribute • Kann mit WSGI Containern benutzt werden • Autor: Ian Bicking $ pip install virtualenv
  • 13. virtualenv: Isolierte Python Umgebungen • Python Version wählbar (zum Teil als Symlink) • Eigenes bin Verzeichnis • Eigenes site-packages Verzeichnis
  • 14. virtualenv: Struktur testenv/ |-- bin | |-- activate | |-- activate_this.py | |-- easy_install | |-- easy_install-2.6 | |-- pip | |-- python | `-- python2.6 -> python |-- include | `-- python2.6 -> /PREFIX/include/python2.6 `-- lib `-- python2.6 |-- UserDict.py -> /PREFIX/lib/python2.6/UserDict.py |-- ... |-- distutils |-- ... |-- orig-prefix.txt |-- ... |-- site-packages |-- site.py |-- ... `-- warnings.py -> /PREFIX/lib/python2.6/warnings.py
  • 15. virtualenvwrapper • Erweiterung für virtualenv • Erleichtern das Erstellen, Löschen und Management der virtualenvs • Autor: Doug Hellmann $ pip install virtualenvwrapper $ mkdir ~/.virtualenvs $ export WORKON_HOME=$HOME/.virtualenvs $ source /usr/local/bin/virtualenvwrapper.sh
  • 16. Einsatz in der Praxis
  • 18. modern-package-template • PasteScript Template • distribute • buildout • Autor: Sridhar Ratnakumar $ pip install modern-package-template
  • 19. modern-package-template $ paster create -t modern_package testpackage Selected and implied templates: modern-package-template#modern_package Package with distribute and buildout support Variables: egg: testpackage package: testpackage project: testpackage Enter version (Version (like 0.1)) ['0.1']: Enter description (One-line description of the package) ['']: A test package. Enter keywords (Space-separated keywords/tags) ['']: test package Enter author (Author name) ['']: Markus Zapke-Gründemann Enter author_email (Author email) ['']: info@keimlink.de Enter url (URL of homepage) ['']: http://www.keimlink.de/ Enter license_name (License name) ['']: BSD Creating template modern_package Creating directory ./testpackage Copying HACKING.txt to ./testpackage/HACKING.txt Copying MANIFEST.in to ./testpackage/MANIFEST.in Copying NEWS.txt to ./testpackage/NEWS.txt Copying README.rst to ./testpackage/README.rst Copying bootstrap.py to ./testpackage/bootstrap.py Copying buildout.cfg_tmpl to ./testpackage/buildout.cfg Copying setup.py_tmpl to ./testpackage/setup.py Running /usr/bin/python setup.py egg_info
  • 20. modern-package-template Verzeichnisstruktur testpackage/ |-- .gitignore |-- .hgignore |-- HACKING.txt |-- MANIFEST.in |-- NEWS.txt buildout |-- README.rst |-- bootstrap.py distribute |-- buildout.cfg |-- setup.py `-- src |-- testpackage `-- testpackage.egg-info
  • 22. virtualenv anlegen zappi ~$ virtualenv testenv New python executable in testenv/bin/python Installing setuptools............done. zappi ~$ virtualenv --distribute testenv New python executable in testenv/bin/python Installing distribute................................................ ..................................................................... ............................................................done. $ export VIRTUALENV_USE_DISTRIBUTE=1
  • 23. virtualenv aktivieren und deaktivieren zappi ~/$ cd testenv zappi ~/testenv$ . bin/activate (testenv)zappi ~/testenv$ deactivate zappi ~/testenv$
  • 25. mkvirtualenv zappi ~$ mkvirtualenv testenv New python executable in testenv/bin/python Installing setuptools............done. virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/predeactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/postdeactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/preactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/postactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/get_env_details (testenv)zappi ~$
  • 26. mkvirtualenv zappi ~$ mkvirtualenv --no-site-packages --distribute testenv New python executable in testenv/bin/python Installing distribute................................................ ..................................................................... ............................................................done. virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/predeactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/postdeactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/preactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/postactivate virtualenvwrapper.user_scripts Creating /Users/zappi/.virtualenvs/ testenv/bin/get_env_details (testenv)zappi ~$
  • 28. lssitepackages (testenv)zappi ~$ lssitepackages distribute-0.6.10-py2.6.egg easy-install.pth pip-0.7.1-py2.6.egg setuptools.pth (testenv)zappi ~$ lssitepackages -l total 8 drwxr-xr-x 10 zappi zappi 340 Aug 10 19:22 distribute-0.6.10-py2.6.egg -rw-r--r-- 1 zappi zappi 237 Aug 10 19:22 easy-install.pth drwxr-xr-x 4 zappi zappi 136 Aug 10 19:22 pip-0.7.1-py2.6.egg -rw-r--r-- 1 zappi zappi 30 Aug 10 19:22 setuptools.pth
  • 29. cdsitepackages (testenv)zappi ~$ cdsitepackages (testenv)zappi ~/.virtualenvs/testenv/lib/python2.6/site-packages$ ls -l total 8 drwxr-xr-x 10 zappi zappi 340 Aug 10 19:22 distribute-0.6.10-py2.6.egg -rw-r--r-- 1 zappi zappi 237 Aug 10 19:22 easy-install.pth drwxr-xr-x 4 zappi zappi 136 Aug 10 19:22 pip-0.7.1-py2.6.egg -rw-r--r-- 1 zappi zappi 30 Aug 10 19:22 setuptools.pth
  • 30. add2virtualenv (testenv)zappi ~/Projekte/Python$ add2virtualenv django-dev Warning: Converting "django-dev" to "/Users/zappi/Projekte/Python/django-dev" (testenv)zappi ~/Projekte/Python$ lssitepackages distribute-0.6.10-py2.6.egg easy-install.pth pip-0.7.1-py2.6.egg setuptools.pth virtualenv_path_extensions.pth virtualenv_path_extensions.pth: /Users/zappi/Projekte/Python/django-dev
  • 32. workon zappi ~$ workon testenv (testenv)zappi ~$
  • 33. rmvirtualenv (testenv)zappi ~$ rmvirtualenv testenv ERROR: You cannot remove the active environment ('testenv'). Either switch to another environment, or run 'deactivate'. (testenv)zappi ~$ deactivate zappi ~$ rmvirtualenv testenv
  • 34. Hooks ~/.virtualenvs/testenv/bin/ |-- get_env_details |-- postactivate |-- postdeactivate |-- preactivate `-- predeactivate ~/.virtualenvs/ |-- get_env_details |-- initialize |-- postactivate |-- postdeactivate |-- postmkvirtualenv |-- postrmvirtualenv |-- preactivate |-- predeactivate |-- premkvirtualenv `-- prermvirtualenv
  • 35. pip
  • 36. pip install $ pip install Markdown Downloading/unpacking Markdown Downloading Markdown-2.0.3.zip (94Kb): 94Kb downloaded Running setup.py egg_info for package Markdown Installing collected packages: Markdown Running setup.py install for Markdown changing mode of build/scripts-2.6/markdown from 644 to 755 changing mode of /Users/zappi/.virtualenvs/testenv/bin/markdown to 755 Successfully installed Markdown Cleaning up...
  • 37. pip install $ pip install Django==1.1.2 $ pip install http://effbot.org/downloads/Imaging-1.1.6.tar.gz $ pip install -e svn+http://svn.myproject.org/svn/MyProject/ trunk#egg=MyProject $ pip install -e svn+http://svn.myproject.org/svn/MyProject/ trunk@2019#egg=MyProject $ pip install --upgrade celery
  • 38. pip install $ cat requirements.txt Django==1.1.2 nose==0.11 -e svn+http://mycompany/svn/MyApp/trunk@1045#egg=MyApp -e svn+http://mycompany/svn/MyLibrary/trunk@1058#egg=MyLibrary $ pip install -r requirements.txt Downloading/unpacking nose==0.11 (from -r requirements.txt (line 2)) Downloading nose-0.11.0.tar.gz (249Kb): 249Kb downloaded Running setup.py egg_info for package nose no previously-included directories found matching 'doc/.build' Downloading/unpacking Django==1.1.2 (from -r requirements.txt (line 1)) Downloading Django-1.1.2.tar.gz (5.7Mb): 5.7Mb downloaded Running setup.py egg_info for package Django Installing collected packages: Django, nose Running setup.py install for Django changing mode of build/scripts-2.6/django-admin.py from 644 to 755 changing mode of /Users/zappi/.virtualenvs/devenv/bin/django-admin.py to 755 Running setup.py install for nose no previously-included directories found matching 'doc/.build' Installing nosetests-2.6 script to /Users/zappi/.virtualenvs/devenv/bin Installing nosetests script to /Users/zappi/.virtualenvs/devenv/bin Successfully installed Django nose Cleaning up...
  • 39. pip install $ pip install -E ~/.virtualenvs/devenv -r requirements.txt Downloading/unpacking nose==0.11 (from -r requirements.txt (line 2)) Downloading nose-0.11.0.tar.gz (249Kb): 249Kb downloaded Running setup.py egg_info for package nose no previously-included directories found matching 'doc/.build' Downloading/unpacking Django==1.1.2 (from -r requirements.txt (line 1)) Downloading Django-1.1.2.tar.gz (5.7Mb): 5.7Mb downloaded Running setup.py egg_info for package Django Installing collected packages: Django, nose Found existing installation: Django 1.1.1 Not uninstalling Django at /Library/Python/2.6/site-packages, outside environment / Users/zappi/.virtualenvs/devenv/bin/.. Running setup.py install for Django changing mode of build/scripts-2.6/django-admin.py from 644 to 755 changing mode of /Users/zappi/.virtualenvs/devenv/bin/django-admin.py to 755 Found existing installation: nose 0.11.1 Not uninstalling nose at /Library/Python/2.6/site-packages, outside environment / Users/zappi/.virtualenvs/devenv/bin/.. Running setup.py install for nose no previously-included directories found matching 'doc/.build' Installing nosetests-2.6 script to /Users/zappi/.virtualenvs/devenv/bin Installing nosetests script to /Users/zappi/.virtualenvs/devenv/bin Successfully installed Django nose Cleaning up...
  • 40. pip install $ pip install anyjson boo Downloading/unpacking anyjson Downloading anyjson-0.2.4.tar.gz Running setup.py egg_info for package anyjson Downloading/unpacking boo Could not find any downloads that satisfy the requirement boo No distributions at all found for boo Storing complete log in /Users/zappi/.pip/pip.log
  • 41. pip uninstall $ pip uninstall Markdown Uninstalling Markdown: /Users/zappi/.virtualenvs/testenv/bin/markdown /Users/zappi/.virtualenvs/testenv/lib/python2.6/site-packages/ Markdown-2.0.3-py2.6.egg-info /Users/zappi/.virtualenvs/testenv/lib/python2.6/site-packages/ markdown Proceed (y/n)? y Successfully uninstalled Markdown
  • 42. pip & PyPI Mirrors PEP 381: Mirroring infrastructure for PyPI $ pip install --use-mirrors Django oder $ export PIP_USE_MIRRORS=true
  • 43. pip freeze $ pip freeze Django==1.2.1 amqplib==0.6.1 anyjson==0.2.4 billiard==0.3.1 carrot==0.10.5 celery==1.0.5 distribute==0.6.10 django-debug-toolbar==0.8.3 django-picklefield==0.1.6 importlib==1.0.2 python-dateutil==1.5 wsgiref==0.1.2 $ pip freeze > requirements.txt
  • 44. pip search $ pip search markdown Markdoc - A lightweight Markdown-based wiki build tool. markdown2 - markdown2: A fast and complete Python implementaion of Markdown. Argot - argot text markup -- a markdown dialect Flask-Markdown - Small extension to make using markdown easy Markdown - Python implementation of Markdown. INSTALLED: 2.0.3 (latest) django-markdown2 - This is a simple app, which supplies a single template tag for markdown markup. tiddlywebplugins.markdown - Markdown rendering for TiddlyWeb discount - A Python interface for Discount, the C Markdown parser tiddlywebplugins.simplewiki - A simple markdown based wiki in TiddlyWeb django-markdown-deux - a Django app that provides template tags for using Markdown (using the python-markdown2 processor) pymarkdown_minisite - Parse a list of markdown files to a website with index. html2text - Turn HTML into equivalent Markdown-structured text. markdown2latex - Extension django-autolinks - App for storing links and automatic link extraction from markdown texts. collective.transform.multimarkdown - MultiMarkdown text transform for Plone
  • 45. pip completion $ pip completion --bash >> ~/.profile $ pip completion --zsh >> ~/.zprofile
  • 46. Links • http://pypi.python.org/pypi/distribute • http://guide.python-distribute.org/ • http://pip.openplans.org/ • http://pypi.python.org/pypi/virtualenv • http://pypi.python.org/pypi/virtualenvwrapper • http://pypi.python.org/pypi/modern-package- template
  • 47. Lizenz Dieses Werk ist unter einem Creative Commons Namensnennung-Weitergabe unter gleichen Bedingungen 3.0 Unported Lizenzvertrag lizenziert. Um die Lizenz anzusehen, gehen Sie bitte zu http://creativecommons.org/licenses/by-sa/3.0/ oder schicken Sie einen Brief an Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.