New projects + agile = releases

When I lived in Belo Horizonte/MG, I used to make hack parties with some friends of mine (nothing to say about all those pizzas and beer).

The hack parties had no specific goal, but a main idea: Hack some free software, and share the knowledge.

Many of us, but specifically Lincoln and I, used to create new projects in every hack party,but only a handful of those were actually released. It was often matter for jokes like: “Oh, you are up to raise the “too many projects” exception”.

I have two words for that fact: “not agile”.

Our projects were often POCs, and we had no culture of TDD, short releases and so on.

But since I started to work at Globo.com, I learned so much about agile, specially Scrum. And some months ago I’ve just accomplished what I call as “agile feeling”.

I mean, it’s a feeling that I can deliver software with quality in a short period of time.

But how ?

The idea is quite simple, you just have to follow some principles:

Think simple

This basically means focusing at the problem at hand, never trying to solve future problems you don’t have. Most of the time the problems your foresaw will never happen, yet you spent a lot of time preparing for them.

Test before programming

Write tests for small parts of your software, they will be very modular, and you will get a trust-able software, and I can assure you that you will be 100% able to embrace the changes.

Release fully functional versions, with simple features

As human beings, we want to embrace all possibilities and solve all possible problems at once.

But this is not agile at all. Talk to your client, be pragmatic, he will like to listen the truth: “You can not ship a full-featured final version of software within the term. But you can totally ship a primary version, fully functional, with all the basic needs of the client. Keep improving the software in next releases”

I tried to summarize those thoughts, but I need blog posts for each one.

Applying those thoughts to personal projects

As I said, I have unfinished projects, and they are still unfinished, mostly because were started with a non-agile approach, and I can’t get interested to finish them.

But there are a few projects I worked in, and others I am the creator. For instance:

  • Dead Parrot, a pythonic RESTFul framework django-based. Is on release 0.1-hellopolly, being used within some globo.com projects.
  • Ma-Chérie, a simple filesystem-based web application to navigate through pictures. Current release: 0.1
  • Sponge, a tiny web framework built on top of CherryPy and used Genshi as default template language. Sponge is the base of Ma-Chérie. Current release: 0.1
  • Pyccuracy, s BDD acceptance testing tool. Heynemann started that project, as a comitter, I worked in the biggest refactoring. Current release 1.0.3-viagra
  • Sleepy, is a crude, slow and rough template language, 100% based in regular expressions (which mades sleepy so slow). Actually I do not plan release it by now,  I am just having some proofs of concept of how possible is to write a template language 100% regex based, just with TDD.

All projects above, except Sleepy, were released as well, all them were developed with TDD and have  a good code coverage.

But the big deal is that, actually they will never get finished, for a simple reason. They will be in continuous development and continuous released as well.

By the way, if you want to contribute, just go to my github profile and check them out.

Hosting and deploying django apps on Dreamhost

About two years ago, I’ve signed up to Dreamhost. My goals were and still being to host my personal projects, websites and so on.

Once I am a Django web developer, one of my first actions were to create a django deployment setup, good and flexible enough. The time passed on and have been got new experiences, and the best desision, i think, was to create a new python sandbox, i mean, a customized python environment.

How is it possible ?

Simple! Just compiling python from scratch, with a fake root path (a prefix)

Anyway, the deployment process involves more variables, like setting both htaccess and dispatch files for each project, installing some basic modules such PIL and MySQL and so on…

So, i ever wanted to create a super duper script to do all that “dirty” work. And i did it last weekend!

I were working ia a freelance job and decided to create a subdomain to host test instance of them.

A new sandbox, ready to make my tests to create the super script.

So folks, i present you the brand new: django_dreamhost.sh :)

It’s composed by 4 files:

  • django_dreamhost.sh itself
  • djangify.template – a template with will become a script to setup new projects (htaccess and dipatch files, for instance)
  • htaccess.template – a template that will become the .htaccess of each project of yours
  • dispatch.template – will become the dispatch.fcgi for your projects as well

“But do i need to download all them ?”, of course NO!

You just download the main script, and he will do all do hard work!

“I wanna contribute, modify or do anything with that script, can I ?”, of course yes! All parts of the script are GPLv2 +

You can also always get the development version through git repository:

git clone http://git.nacaolivre.org/django_dreamhost

Don’t want to get all code, just the script ?

Download it at: http://gnu.gabrielfalcao.com/django_dreamhost/django_dreamhost.sh

What does that script do ?

He will do the following steps:

  1. Download Python, Django, Python-setuptools, Python-fastcgi to a directory called downloads
  2. Extract all
  3. Create a local root at $HOME/.myroot and the subdirs etc and usr
  4. Set the new bin path to you global path through bashrc and bash_profile
  5. Compile and install python to the new prefix: $HOME/.myroot/usr
  6. Install Django, rename django-admin.py to django-admin
  7. Setup your bash-completion to support django scripts
  8. Install the python modules above with the new python
  9. Install PIL and MYSQL modules through easy_install (setuptools)
  10. Download the template scripts to $HOME/projects/script_templates
  11. Replace the custom tags in templates
  12. Move the djangify.template to the new bin PATH: $HOME/usr/bin and give it execution permission

I thinks it’s all.

I currently use Fabric to help on deployment, and i have a quite smart basic setup for it to work with this dreamhost django environment, but it will be approached in the next blog post :)

See you, folks!

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds. Valid XHTML and CSS.