marco-hoyer/statusfile-writer — pull request #1 by mriehl (2014-01-18 14:53:59+00:00)
Title: deploy statusfile_writer as a script

Your codebase is fully python 2.7 and 3 compatible (runs on arch linux here ;-)) but hardcoding the path to the python lib in `statusfile_writer` is enforcing a python 2.6 installation. This PR takes care of compatibility with all other python versions >= 2.6.

Scripts that are in the pybuilder `src/main/scripts` folder are automatically deployed to the bin directory (/usr/bin on most linuxes). This is important so that statusfile-writer can be installed in a virtual env without root permissions. Without this PR, `pip install statusfile-writer` would try to push the file to /usr/bin and fail.

We can also avoid using `/usr/lib/python2.6/site-packages` which is very brittle, could also lead to problem if we build a x86_64 package where the file would be in `/usr/lib64/`.
The solution is simple : import the module (python already knows where to look for installed modules) and run it from there.