SlideShare a Scribd company logo
Paver: the build tool you missed




Lukas Linhart
Centrum Holdings
About Me
• Regular pythonista since '05

• Testing and automation obsession

• Centrum Holdings, mostly Django-related work

• Lots of smallish projects
Stumbling upon Paver
• "Setuptools no more"

• Kevin Dangoor To The Rescue
Survey
Who would use a build tool...
Build tool in an interpreted world
• Generated Content In Repository (TM)

• Moving (files) around
...and why in Python?
• Batteries included (tm)

• Integration with pythonic tools
...and why Paver?
• Simple things stay simple

• Complex is possible (or integrated)
Single Point of Entry
As in "Console API"

1 paver bootstrap
2 paver prepare
3 paver run
Getting started (First Task!)
pavement.py :

1 from paver.easy import *
2
3 @task
4 def install_dependencies():
5     sh('pip install --upgrade -r requirements.txt')
Embrace distutils/setuptools
1 from paver.easy import *
2 from paver.setuputils import setup
3
4 setup(**same_args_as_in_setup)
setup.py compatibility
paver minilib

paver generate_setup

(pip install -e worky)
Dependencies
1 @task
2 @needs('install_dependencies')
3 def prepare():
4     """ Prepare complete environment """
5     sh("python setup.py develop")
Overwriting distutils commands
1 @task
2 @needs('html', "minilib", "generate_setup", "distutils.command.sdist")
3 def sdist():
4     pass
Positional arguments
1 @task
2 @consume_args
3 def unit(args):
4     import nose
5     nose.run_exit(
6         argv = ["nosetests"] + args
7     )
CMD options, GNU style
1   @task
2   @cmdopts([
3       ('domain-username=', 'd', 'Domain username'),
4       ('upload-url=', 'u', 'URL to upload to')
5   ])
6   @needs('download_diff_packages')
7   def upload_packages(options):
8       # censored
Oh, options
1 options(
2     minilib=Bunch(
3          extra_files=['doctools', 'virtual']
4     )
5 )
Options (cont.)
1 # inside minilib task
2 options.get('extra_files', [])
Namespace search
1   options(setup=Bunch(version="1.1"))
2   options.version
3   '1.1'
4   options.order('minilib')
5   options.version
6   AttributeError: version
sh
1 myval = sh("cat /etc/fstab", capture=True)
dry
1 # prepare
2 dry("Modify", do_fs_mumbo_jumbo)
path.py
1 @task
2 def publish_docs():
3     builtdocs = path("docs") / options.sphinx.builddir / "html"
4     destdir = options.docroot
5     destdir.rmtree()
6     builtdocs.move(destdir)
Documentation (sphinx)
1 options(
2     sphinx=Bunch(
3          builddir="build",
4          sourcedir="source"
5     )
6 )

And run

1 paver html
Documentation (cog)
1 #<== include('started/oldway/setup.py')==>
2 #<==end==>

configured with

1 options(
2     cog=Bunch(
3     includedir="docs/samples",
4     beginspec="<==",
5     endspec="==>",
6     endoutput="<==end==>"
7     )
8 )
Virtualenv
1 options(
2     virtualenv=Bunch(
3          packages_to_install=["nose", "virtualenv"],
4          install_paver=True,
5          script_name='bootstrap.py',
6          paver_command_line=None,
7          dest_dir="virtualenv"
8     )
9 )
Discovery
Setting up django discovery
 1   from paver.discovery import discover_django
 2
 3   options(
 4       discovery = Bunch(
 5            django = Bunch(
 6                settings_path = "subdir"
 7            )
 8       )
 9   )
10
11   discover_django(options)
Happy Django command panda
paver django.validate
Future
• virtualenv improvements

• VIRTUAL_ENV context autodetection

• more integration (first-class fabric, ...)

• what would you like?
Q & (some) A
Fork us on github
http://github.com/paver/paver/
paver@googlegroups.com

More Related Content

What's hot

Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.
Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.
Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.
Graham Dumpleton
 
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NYPuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
Puppet
 
Capistrano Rails
Capistrano RailsCapistrano Rails
Capistrano Rails
Александр Ежов
 
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
nvpuppet
 
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
Puppet
 
Intro django
Intro djangoIntro django
Intro django
Alexander Lyabah
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
Simone Federici
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Takayuki Shimizukawa
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
Graham Dumpleton
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014
Henning Jacobs
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful wedding
Stéphane Wirtel
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
bcoca
 
Don't do this
Don't do thisDon't do this
Don't do this
Richard Jones
 
The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212
Mahmoud Samir Fayed
 
并发模型介绍
并发模型介绍并发模型介绍
并发模型介绍
qiang
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2
Brian Schott
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
Peter Eisentraut
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
Murali Boyapati
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
SmartTools
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Cosimo Streppone
 

What's hot (20)

Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.
Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.
Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.
 
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NYPuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
 
Capistrano Rails
Capistrano RailsCapistrano Rails
Capistrano Rails
 
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
 
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
 
Intro django
Intro djangoIntro django
Intro django
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful wedding
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Don't do this
Don't do thisDon't do this
Don't do this
 
The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212
 
并发模型介绍
并发模型介绍并发模型介绍
并发模型介绍
 
Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2Using Ansible Dynamic Inventory with Amazon EC2
Using Ansible Dynamic Inventory with Amazon EC2
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 

Viewers also liked

Odell permeable pavers-2of3
Odell permeable pavers-2of3Odell permeable pavers-2of3
Odell permeable pavers-2of3
Northern Engineering
 
Paver For PyWorks 2008
Paver For PyWorks 2008Paver For PyWorks 2008
Paver For PyWorks 2008
Kevin Dangoor
 
Asphalt paver
Asphalt  paverAsphalt  paver
Asphalt paver
Hashan Gunawardena
 
Shree Sai Pavers Presentation.pptx
Shree Sai Pavers Presentation.pptxShree Sai Pavers Presentation.pptx
Shree Sai Pavers Presentation.pptx
shree sai pavers
 
Building stone stone masonry
Building stone   stone masonryBuilding stone   stone masonry
Building stone stone masonry
Siddharth Siddhu
 
Ramesh kumar
Ramesh kumarRamesh kumar
Ramesh kumar
Ramesh Singh
 

Viewers also liked (6)

Odell permeable pavers-2of3
Odell permeable pavers-2of3Odell permeable pavers-2of3
Odell permeable pavers-2of3
 
Paver For PyWorks 2008
Paver For PyWorks 2008Paver For PyWorks 2008
Paver For PyWorks 2008
 
Asphalt paver
Asphalt  paverAsphalt  paver
Asphalt paver
 
Shree Sai Pavers Presentation.pptx
Shree Sai Pavers Presentation.pptxShree Sai Pavers Presentation.pptx
Shree Sai Pavers Presentation.pptx
 
Building stone stone masonry
Building stone   stone masonryBuilding stone   stone masonry
Building stone stone masonry
 
Ramesh kumar
Ramesh kumarRamesh kumar
Ramesh kumar
 

Similar to Paver: the build tool you missed

Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010
Qiangning Hong
 
Isolated development in python
Isolated development in pythonIsolated development in python
Isolated development in python
Andrés J. Díaz
 
Python and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementPython and Oracle : allies for best of data management
Python and Oracle : allies for best of data management
Laurent Leturgez
 
Django at Scale
Django at ScaleDjango at Scale
Django at Scale
bretthoerner
 
SwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup GroupSwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup Group
Ernest Jumbe
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Yros
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
Pascal Rettig
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
ericholscher
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
Fabio Fumarola
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
Ben Hall
 
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
Codemotion
 
Migrating from matlab to python
Migrating from matlab to pythonMigrating from matlab to python
Migrating from matlab to python
ActiveState
 
Python update in 2018 #ll2018jp
Python update in 2018 #ll2018jpPython update in 2018 #ll2018jp
Python update in 2018 #ll2018jp
cocodrips
 
Django Celery
Django Celery Django Celery
Django Celery
Mat Clayton
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
Pôle Systematic Paris-Region
 
Fabric
FabricFabric
Fabric
JS Lee
 
PyWPS at COST WPS Workshop
PyWPS at COST WPS WorkshopPyWPS at COST WPS Workshop
PyWPS at COST WPS Workshop
Jachym Cepicky
 
Thinking Outside The [Sand]Box
Thinking Outside The [Sand]BoxThinking Outside The [Sand]Box
Thinking Outside The [Sand]Box
Michael Genkin
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France
David Delabassee
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
DECK36
 

Similar to Paver: the build tool you missed (20)

Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010
 
Isolated development in python
Isolated development in pythonIsolated development in python
Isolated development in python
 
Python and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementPython and Oracle : allies for best of data management
Python and Oracle : allies for best of data management
 
Django at Scale
Django at ScaleDjango at Scale
Django at Scale
 
SwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup GroupSwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup Group
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
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
 
Migrating from matlab to python
Migrating from matlab to pythonMigrating from matlab to python
Migrating from matlab to python
 
Python update in 2018 #ll2018jp
Python update in 2018 #ll2018jpPython update in 2018 #ll2018jp
Python update in 2018 #ll2018jp
 
Django Celery
Django Celery Django Celery
Django Celery
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
Fabric
FabricFabric
Fabric
 
PyWPS at COST WPS Workshop
PyWPS at COST WPS WorkshopPyWPS at COST WPS Workshop
PyWPS at COST WPS Workshop
 
Thinking Outside The [Sand]Box
Thinking Outside The [Sand]BoxThinking Outside The [Sand]Box
Thinking Outside The [Sand]Box
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
 

Paver: the build tool you missed