Programming in Python
So I've mostly used python for one off scripts and tools and at one point for a serious foray into Django - but never came into a situation where I'd thought of publishing anything.
Hmm - crossed that bridge over this weekend - and its been a fun journey. I'm writing this post with what I wrote :)
Things I've picked up
Code
- Better understanding into Python modules, classes and code organization for libraries.
- Good unit tests
- Mocking in python
Packaging
- Packaging with
setup.py pip,setuptools,easy_installand their idiosyncracies- Install a platform specific script
- PyPI - registering and publishing
- Tutorial One point to note - if you create the
.pypircmanually, you will need to manually do apython setup.py register. If you skip that,python setup.py sdist uploadwill fail with a 403.
- Tutorial One point to note - if you create the
Testing
virtualenv- this link- Testing platform specific scripts installed with tools above
- Coverage
Coding/Style/Syntax linting
pyflakes,pylame,pep8and integration in Vim with Syntastic
What I really, really liked
- That I didn't miss a debugger
- That tests were short and sweet
- good code coverage out of the box
pip- Overall, how pleasant it was and how much I enjoyed it.
Where I had hiccups
- Mocks in python were a little hard to debug/understand
- Should have written the tests first - but it came as an afterthought after I decided to publish.
- Finding good documentation on packaging - for ex:, its hard to find a good walkthrough of how to publish
Just putting finishing touches and a little polish for a v0.9 release. Basically this post itself is nothing but a test. Should be out with it in a day or two.
No comments :
Post a Comment