Foundations of Agile Python Development

Python, agile project methods, and a comprehensive open source tool chain

Jeff Younker

Publisher: Apress, 2008, 393 pages

ISBN: 1-59059-981-0

Keywords: Python

Last modified: Aug. 15, 2009, 2:07 a.m.

This book gives you a complete set of open source tools to turbocharge your Python projects, and shows you how to integrate them into a smoothly functioning whole.

Eclipse and Pydev make an excellent Python IDE. Python ships with an xUnit-based unit-testing framework. Nose is great for running tests, supplemented by PyFit for functional testing. Setuptools is your build harness and packaging mechanism, with functionality similar to Maven in Java. Subversion provides a place to store your code, and Buildbot is an ideal continuous integration server. This book shows you how to tie all of these pieces together into one tool chain!

Foundations of Agile Python Development is the first book to apply these sought-after principles to Python developers, introducing both the tools and techniques built and supported by the Python community. Authored by Jeff Younker, a well-known member of Python's agile community who is perhaps best known for his creation of a popular Python testing framework, this book is sure to be a hit among readers who may have reached their limits of knowledge regarding the Python language, yet are seeking to improve their understanding of how sound processes can boost productivity to unparalleled heights.

  • CHAPTER 1: What Is Agile Development?
    • Why More Methodologies?
    • A Little History
    • Planning and Agile Development
    • What Are Agile Methods?
      • Pair Programming
      • User Stories
      • The System Metaphor
      • On-Site Customers
      • Unit Tests
      • Test-Driven Development
      • Refactoring
      • Simple Design
      • Collective Code Ownership
      • Short Iterations
      • Continuous Reflection
      • Continuous Integration
      • Documentation
    • Summary
  • CHAPTER 2: The IDE: Eclipsing the Command Line
    • Installing Eclipse
    • Installing Plug-Ins
    • Installing and Configuring Pydev
    • Your First Project
    • Looking Under the Hood
    • Paying for More Functionality
    • Summary
  • CHAPTER 3: Revision Control: Subverting Your Code
    • Revision Control Phylum
    • What Subversion Does for You
    • Getting Subverted
    • Working with Your Subverted Code
      • Examining Files
      • Adding Files
      • Copying and Moving Files
      • Deleting Files
      • Reverting Changes
      • Modifying a File
    • Updating Your Working Copy
    • Conflicting Changes
    • Subverting Eclipse
      • Sharing Your Subverted Project
      • Importing from Subversion
    • Working with a Subverted Eclipse
      • The Team Repository View
      • Adding a File
      • Committing Changes
      • Editing a File
      • Reverting Changes
      • Resolving Conflicts
      • Deleting Files
      • Moving Files
      • Renaming Files
      • Copying Files
      • Reverting Moves, Renames, and Copies
    • Summary
  • CHAPTER 4: Setuptools: Harnessing Your Code
    • The Project: A Simple RSS Reader
    • Python Modules
    • The Old Way
    • The New Way: Cooking with Eggs
    • Some Notes About Building Multiple Versions
    • Installing Setuptools
    • Getting Started with Setuptools
    • Building the Project
    • Installing Executables
    • Dependencies
    • Think Globally, Install Locally
      • Removing an Existing Package: Undoing Your Hard Work
      • Installing from the Local Copy
    • Fixing Options with setup.cfg
    • Bootstrapping Setuptools
    • Subverting Subversion: What Shouldn’t Be Versioned
      • The Easy Way with Eclipse
    • Checking in Changes: Not Losing It
    • Working in Development Mode
    • Summary
  • CHAPTER 5: A Build for Every Check-In
    • Buildbot Architecture
    • Installing Buildbot
    • Configuring the Build System
    • Mastering Buildbot
    • Enslaving Buildbot
    • Hooking Up Source Control
    • Using the Source
    • Subversion to Buildbot, Over
    • A Python for Every Builder
    • Finally, a Real Build Succeeds
    • Installing the Build
    • Supporting Python 2.4 Builds
    • Ensuring Local Dependency Processing
    • Keeping Up Appearances
    • Summary
  • CHAPTER 6: Testing: The Horse and the Cart
    • Unit Testing
    • The Problems with Not Unit Testing
    • Pessimism
    • Test-Driven Development
    • Knowing Your Unit Tests
    • unittest and Nose
    • A Simple RSS Reader
    • The First Tests
    • Finding Tests with Nose
    • Skipping Slow Tests
    • Integrating the Tests into the Environment
      • Running Tests After Every Change
      • Running the Complete Test Suite in Development
      • Buildbot with Unit Tests
    • Summary
  • CHAPTER 7: Test-Driven Development and Impostors
    • Moving Beyond Acceptance Tests
    • Renaming
    • Overriding Existing Methods: Monkeypatching
      • Monkeypatching and Imports
      • The Changes Go Live
    • Using Data Files
    • Isolation
    • Rolling Your Own
    • Python Quirks
    • Mocking Libraries
    • Aggregating Two Feeds
    • A Simple pMock Example
    • Implementing with pMock
      • Test: Defining combine_feeds
      • Test: Defining add_single_feed
      • Refactoring: Extracting AggregateFeed
      • Refactoring: Moving add_single_feed
      • Test: Defining create_entry
      • Test: Ensuring That AggregateFeed Creates a FeedEntry Factory
      • Test: Defining add
      • Test: AggregateFeed.entries Is Always Initialized to a Set
      • Test: Defining FeedEntry.from_parsed_feed
      • Test: Defining feed_entry_listing
      • Test: Defining feeds_from_urls
      • Test: AggregateFeed Initializes the FeedParser Factory
      • Test: Defining from_urls
      • Refactoring: Reimplementing from_urls
      • Refactoring: Condensing Some Tests
      • Test: Formatting Feed Entry Listings
      • Test: Defining print_entry_listings
      • Test: FeedWriter Initializes the stdout Attribute
      • Test: Empty AggregateFeeds Generate No Output
      • Test: Defining is_empty
      • Test: Defining new_main
      • Test: The Application Initializes Dependencies
      • Refactoring: Making new_main the New main
    • A Simple PyMock Example
      • Monkeypatching
      • Saying the Same Thing Differently
    • Implementing with PyMock
      • Test: from_urls and Mocking External Modules
      • Test: Defining add_single_feed
      • Refactoring: Moving Methods to a New Object
      • Refactoring: Moving add_single_feed
      • Refactoring: Moving from_urls()
      • Test: create_entry() and Mocking Class Constructors
      • Tests: Defining add and AggregateFeed.__init__
      • Test: Defining FeedEntry.__init__
      • Test: Defining listing
      • Test: entry_listings Should Be Sorted
      • Test: Defining print_entry_listings
      • Test: print_entry_listings Should Do Nothing with Empty Feeds
      • Test: is_empty and the Unproven Test
      • Test: new_main, Hooking It All Together
      • Test: RSReader Initialization
      • Finishing Up: Activating the New Functionality
    • Other pMock and PyMock Features
      • Raising Exceptions with pMock
      • Raising Exceptions with PyMock
      • Playback Counts with pMock
      • Playback Counts with PyMock
      • Mocking Attribute Setters with PyMock
      • Mocking Generators with PyMock
      • Using PyMock with unittest
    • Summary
  • CHAPTER 8: Everybody Needs Feedback
    • Measuring Software Quality
    • Measurements
    • Quantitative Measurements: How Much Is That Doggie in the Window?
    • Code Coverage
    • Complexity Measurements
    • Velocity: When Are We Done?
    • Qualitative Measurements: It’s a Shih Tzu!
    • Coding Conventions
    • Welcome Back to Python
    • Never Try to Fix a Social Problem with a Technical Solution
    • Code Reviews
    • Renaming
    • Communication
    • Technological Feedback: Bad Programmer, No Cookie
    • Coercion at the Keyboard
    • When Code Is Submitted
    • Buildbot and Coverage
    • Summary
  • CHAPTER 9: Databases
    • A New Religion
    • Blurring the Boundaries
    • Concealing Data Access
    • Object-Relational Mappers
      • The Active Record Pattern
      • The Data Mapper Pattern
      • The Unit of Work Pattern
    • Python ORMs
      • SQLObject
      • SQLAlchemy
    • Building the Database
    • Testing
    • Refactorings
    • Migrations
      • The Instructions
      • Numbering Migrations and Playing Them Back
      • Where to Put the Migration Mechanism
      • DBMigrate: A Migration Mechanism
    • Summary
  • CHAPTER 10: Web Testing
    • Really Simple Primer
      • HTML
      • CSS
      • XML
      • URI and URL
      • HTTP
      • JavaScript
    • Web Servers and Web Applications
      • WSGI
      • Using the write Callback
    • WSGI Middleware
    • Testing Web Applications
      • Graphics and Images
      • Markup
      • Testing JavaScript
    • Using JsUnit
      • Running a Test
      • How It Works
      • Connoisseur of the Undefined
      • Adding a Little More Realism
      • Manipulating the DOM
      • Aggregating Tests
      • Running Tests by URL
    • Summary
  • CHAPTER 11: Functional Testing
    • Running Acceptance Tests
    • PyFit
      • Writing Requirements
      • A Simple PyFit Example
      • Giving the Acceptance Tests a Home
      • Your First FIT
    • FIT into Buildbot
      • Preparing the Slave
      • Run New Builder, Run!
      • Making the Reports Available
      • Getting Regular Builds
      • What’s Left?
    • Summary

Reviews

Foundations of Agile Python Development

Reviewed by Roland Buresund

Very Good ******** (8 out of 10)

Last modified: Aug. 15, 2009, 2:08 a.m.

This is exactly what the title promises. It is a book about what you should know before you start your development of your Python application, regardless of framework or toolkit you decide to choose. You may or may not agree with everything the author says, but his views are at least valid views and the coverage is as you may expect from such a large topic and sucha small book.

All in all, I think this is a vary valuable book for anyone new to Python development, as it covers the basics very well, and allows you to continue on your own and find more information, without invalidating everything else the author has to say.

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required