Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Upgrade your Web Development Toolchain by Blais...
Search
PyCon 2014
April 12, 2014
1.1k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Upgrade your Web Development Toolchain by Blaise Laflamme
PyCon 2014
April 12, 2014
More Decks by PyCon 2014
See All by PyCon 2014
Postgres Performance for Humans by Craig Kerstiens
pycon2014
28
3.7k
Technical Onboarding, Training, and Mentoring by Kate Heddleston and Nicole Zuckerman
pycon2014
1
2.4k
"My big gay adventure. Making, releasing and selling an indie game made in python." by Luke Miller
pycon2014
2
1.7k
Farewell and Welcome Home, Python in Two Genders by Naomi_Ceder
pycon2014
1
790
Deliver Your Software in an Envelope by Augie Fackler and Nathaniel Manista
pycon2014
1
620
Hitchhikers Guide to Free and Open Source Participation by Elena Williams
pycon2014
6
1.3k
Localization Revisted (aka. Translations Evolved) by Ruchi Varshney
pycon2014
0
740
Smart Dumpster by Bradley E. Angell
pycon2014
0
570
Software Engineering for Hackers: Bridging the Two Solitudes by Tavish Armstrong
pycon2014
0
790
Featured
See All Featured
Building Adaptive Systems
keathley
44
3k
We Are The Robots
honzajavorek
0
240
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
550
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Making Projects Easy
brettharned
120
6.7k
Prompt Engineering for Job Search
mfonobong
0
330
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
190
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
840
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Between Models and Reality
mayunak
4
330
Transcript
Upgrade your Web Development Toolchain Blaise Laflamme Pycon 2014
About Me • Full-Stack Web Development • Lead Projects •
Lead Teams • Still learning a lot everyday
What This Talk is About • Ideas and patterns •
Combining tools • Working with people on projects
What This Talk is not About • Strong opinions •
Cookbook recipes • In-depth technical examples
Best Practices & Patterns • Dogmatism is never a good
thing • Should always have a significant benefit • Stick to what really makes a difference
Problems to Solve • Tie up multiple in-development projects •
Tie up multiple environments & tools • Mix up development teams
Point Of View • Separation of concerns • Use known
tools • Adapt to context
What will people do if You die!
Project Workflow • Server provisioning & setup • WebApp development
• Application deployment
Provisioning & Deployment • Developer’s machine • Dedicated, Linode, Rackspace,
Heroku, … • Ansible, Saltstack, Chef, Puppet, Docker, …
We should not care
They should call you in their process
App Environment should be self-contained
Running on multiple platforms and environments provides a better tested
and robust codebase
WebApp Development • Back end • Python, frameworks, template engines,
… • Front end • HTML, CSS, Javascript, frameworks, …
They have both developed their own expertise, tools and workflows
Package Management Back end Package Management $ easy_install pyramid $
easy_install pyramid==1.5 $ pip install pyramid $ pip install pyramid==1.5 Front end Package Management $ bower install jquery $ bower install jquery#1.11.0
Package Management Back end Package Management setup( name='myproject', version=0.1.0, install_requires=[‘pyramid==1.5’]
) Front end Package Management { "name": "myproject-resources", "version": "0.1.0", "dependencies": { "jquery": “1.11.0” } }
What is Bower? A package manager for the web
Assets Management Back end Assets Management from webassets import Bundle
all_js = Bundle( Bundle('common/libs/jquery/jquery.js'), filters='jsmin', output='gen/packed.js' ) >>> env['all_js'].urls() ('/media/gen/packed.js',)
Assets Management Front end Assets Management module.exports = function (grunt)
{ grunt.initConfig({ jsmin-sourcemap: { dist: { src: 'common/libs/jquery/jquery.js', dest: 'gen/packed.js' } }, }); grunt.loadNpmTasks('grunt-jsmin-sourcemap'); grunt.registerTask('dist', [ 'jsmin-sourcemap:dist' ]); };
What is Grunt? A task runner for automation
Frontend also need • Some sort of include/import/require • Ability
to load nested dependencies
Frontend also need Front end dependencies and requirements require.config({ paths:
{ jquery: 'libs/jquery-1.11.0' } }); … require( ['jquery'], function( $ ) { });
Why would you want frontend to rely on backend dependancy?
You reach a point of separation • Advanced hybrid-application •
SPA (Single Page App) • Backend as an API
You’ll benefit from splitting to multiple projects • One project
per team or «concerns» • Use same global app or project environment • Share common set of tools and patterns
Buildout • Application-centric • For assembly and deployment • Make
assembly of programs repeatable
Buildout • Uses extendable configuration files • Uses extensions •
Uses recipes
Buildout [buildout] extensions = mr.developer extends = https://raw.github.com/reebalazs/ buildout.javascript.yeoman/master/yeoman.cfg parts+
= dirs eggs bower_modules develop = src/myapp1 src/myapp2 ! [dirs] recipe = z3c.recipe.mkdir paths = var
Buildout [sources] myapp1 = git
[email protected]
:blaflamme/myapp1.git myapp2 = git
[email protected]
:blaflamme/myapp2.git
! [eggs] recipe = zc.recipe.egg dependent-scripts = true eggs = appenlight-client myapp1 myapp2 interpreter = py
Provide a development project that builds the application environment
myapp-dev project . ├── Gruntfile.js ├── Makefile ├── bootstrap.py ├──
bower.json ├── buildout.cfg ├── etc └── package.json
Buildout Project Setting the project $ git clone
[email protected]
:blaflamme/myapp-dev.git $
cd myapp-dev $ virtualenv . $ bin/python bootstrap.py $ bin/buildout
You’re done!
myapp-dev project . ├── Gruntfile.js ├── Makefile ├── bin ├──
bootstrap.py ├── bower.json ├── buildout.cfg ├── components ├── develop-eggs ├── eggs ├── etc ├── include ├── lib ├── node_modules ├── package.json ├── parts ├── src └── var
Command Line API • Wrap multiple commands under simpler API
• Use Makefiles, Make is a good tool for this ;)
Makefile HERE = $(shell pwd) BIN = $(HERE)/bin VIRTUALENV =
virtualenv PYTHON = $(HERE)/bin/python virtualenv: $(VIRTUALENV) . bootstrap: $(PYTHON) bootstrap.py buildout: $(BIN)/buildout setup: virtualenv bootstrap buildout
Makefile $ git clone
[email protected]
:blaflamme/myapp-dev.git $ cd myapp-dev $ make
setup
Conclusion • Isolate Application Environment • Organize projects in a
flexible way • Give more power to user & team
Questions?