My Software Development Environment for Python

February 21st, 2011 • Comments Off

Python is my favorite programming language for multiple reasons. Most important though is that it has a strong community, a Benevolent Dictator For Life (BDFL) and allows rapid development of high quality software. I love automation of processes wherever possible because it saves time. Here is a list of tools, methodologies, stuff I use to ensure code quality:

  • Source Code Management (SCM) – Currently I prefer using Mercurial. It is written in Python and has a low learning curve. Although similar to GIT I don’t think there is much to argue against or in favor of GIT over Mercurial. Most of the time I’m fiddeling around with the command line but for merging I use meld (nice 3-way view) and hgview (it’s faster than the hgk extension) for viewing the current status of the repository.
  • Issue Tracking – Since I’m coding in small teams only I find a story board which is located next to the code most convenient. For bigger teams I would favor Mantis.
  • Project hosting – Although I’m not a huge fan of Sourceforge it currently offers all I need. Major issue against Sourceforge is the performance of the service. But the ability to deploy website is a must have for me.
  • Quality assurance – I use: pylint for code style checks (PEP8 conform of course :-) ) (and with a rating with 10 out of 10 :-) ), pycoverage for coverage reports (I love to get 100% code coverage with my unittests (Also see this post here) – and yes that’s possible), pygenie to review the complexity, pycallgraph to get an overview of how the code behaves during run-time, and last but no least pep8 for some sanity checks. All these tools are embedded Hudson and reports are generated automatically (!!) without human interaction *yeeha*
  • Reporting & Builds – Probably because I have some Sun Microsystems background I like hudson – It runs as a service on my machine in the background and is bound to my local branch of my python code (Polls every 5 minutes). Each time I do a ‘hg commit’ it tests the software and creates a bunch of reports. Nicely integrated are the pylint (via Violations plugins) and the Coverage reporting. So I just have to visit the local hudson page and see what is going on. I could do automatic releases of my code and deploy those on pypi but I don’t because in some months I don’t code that much. (BTW.: I’m not contributing to the Hudson, Jenkins discussion :-) )
  • Packaging – I use pip to access pypi – Why? Because of the uninstallation and build features it offers. And also the pip requirement files are nice!
  • Documentation – I find the sphinx tool very convenient. It comes with nice themes, good code integration and easy to write markup language.
  • IDE – I use IDLE for smaller edits, when doing real coding I currently run Aptana Studio Beta 3 – Try it out – it has some nice features (Like the build in Terminal, Python support, Refactoring, Code Formatting, Usable for website development as well etc.).
  • Shell script – This is probably not the nicest way but for now the fastest. I have one shell scripts in place which is called by hudson (Main reason why it is a shell script) and which I use to deploy versions of the software  to pypi. Whenever I deploy those scripts for example first ensure that all tests run and after a successful deployment they create a tag in the SCM with the version string.

Tools I sometimes use during the development of code:

  • tornado web – It is fast, and the asnc calls are nice. The ideal framework to write RESTful service in python.
  • django – For bigger Apps I would recommend the Django Framework
  • SWIG – To call C libraries from python. I still find it the most convenient way – but I’m happy to be told otherwise

Thinks I would like to have replacements for:

  • I would love to see a smartHG instead of smartGIT :-)
  • A mixture of github, bitbucket and SourceForge for project hosting
  • Maybe an replacement for hudson…
  • the SWIG solution…

Overall I’m pretty happy with this setup and find it good for fast coding. I usually write unittests (With test for success, failure and sanity for every routine) first before starting coding. I don’t find it a time waste but actually I’m pretty sure that the overall setup allows me to code and refactor faster.

Maybe others or you (?) also want to writeup their setups and we can start a site like The Setup for Software Development? Please Retweet and share the link!

Update: Also have a look at this Python and Dtrace blog post.

Call graphs for python

September 9th, 2010 • 1 Comment

I’m a big fan of reporting be it reports form automated builds, coverages, API documents etc. To evaluate the python code I’m currently working on I needed Call Graph for Python. After some searching and testing I found this package to be most convenient: http://pycallgraph.slowchop.com/

P.S. If you are running Ubuntu (or similar) a sudo apt-get install python-pycallgraph will install the package. To create the graph simple call: pycallgraph –include=<whatever you need> <your app.py>

A future for the world?

September 6th, 2010 • 1 Comment

Welt mit Zukunft Cover

Franz Josef Radermacher’s book about the current world situation with financial crises, natural disasters and exceeding resources not only describes the current and upcoming problems but also provides solutions towards what he calls an “eco-social market economy”. Beside the fact that the book is well written and quite short compared to the message it delivers, a good overview of what goes wrong and a possible way of solving it is presented. Only critical point would be that it doesn’t describe how we can get there. Still and definitely a book which you should read.

It describes that current established system can not solve the issue – needed is system which controls the free markets and ensure the social liability of our communities. Taxes on resources or a Supervisory Associations for financial markets which approve products before they can be sold are just one step in the right direction.

Tinkering with Illumos

September 1st, 2010 • Comments Off

Honestly I do not really get the point why everybody is so upset about what happened to OpenSolaris. I can understand the steps Oracle took – and do not forget: The source is still under a CDDL license. A bit sad that the community doesn’t get real-time updates anymore.

On the other side I think that the initial idea of the Illumos project to replace the last closed source bits in ON is a good one. But I’m also looking forward to the Solaris 11 Express edition – I know some Solaris developers over at Sun/Oracle and those guys do a great job!

Here is a nice screen shot of Illumos booting BTW:

My Kind Of Town (Chicago is) – Frank Sinatra

July 8th, 2010 • Comments Off

Now this could only happen to a guy like me
And only happen in a town like this
So may I say to each of you most gratef’lly
As I throw each one of you a kiss


This is my kind of town, Chicago is
My kind of town, Chicago is
My kind of people, too
People who smile at you


And each time I roam, Chicago is
Calling me home, Chicago is
Why I just grin like a clown
It’s my kind of town


My kind of town, Chicago is
My kind of town, Chicago is
My kind of razzmatazz
And it has all that jazz


And each time I leave, Chicago is
Tuggin’ my sleeve, Chicago is
The Wrigley Building, Chicago is
The Union Stockyard, Chicago is
One town that won’t let you down
It’s my kind of town

Another beautiful song which Frank Sinatra preformed was just called ‘Chicago’:

Chicago, Chicago–that toddlin’ town.
Chicago, Chicago–I will show you around. I love it.
Bet your bottom dollar you’ll lose the blues in Chicago, Chicago.
The town that Billy Sunday couldn’t shut down.

On State Street, that great street, I’d just want to say -
They do things they don’t do on Broadway.
They have the time, the time of their life.
I saw a man, he danced with his wife.
In Chicago, Chicago, my home town.

Chicago, Chicago–that toddlin’ town.
Chicago, Chicago–I’ll show you around. I love it.
Bet your bottom dollar you’ll lose the blues in Chicago, Chicago.
The town that Billy Sunday could not shut down.

On State Street that great street, I’d just like to say -
They do things that they never do on Broadway.
They have the time, the time of their life.
I saw a man, he danced with his wife.
In Chicago… Chicago… Chicago.
That’s my hometown!

To learn more about these songs Wikipedia has some decent entries about it: 1 2

Page 5 of 19« First...34567...10...Last »