Install post-review as a Python module and install an executable wrapper in the path
Review Request #916 — Created July 15, 2009 and submitted
|Review Board SVN (deprecated)|
This change moves scripts/post-review to rbtools/postreview.py, and adds a reference to this in setup.py so that a wrapper script will be generated and installed. What this means is that on Linux systems, installing RBTools will continue to give a /usr/bin/post-review, which will do the right thing (though now will access specifically the version installed in the Python path), but on Windows we'll now actually get a post-review.exe out of the box. This is the same thing we do for rb-site. The downside of this is that administrators will have to hand out the installable package, if engineers are to install this manually on their system, instead of handing out just the post-review script. Any custom changes (such as setting site defaults) will require building a custom package. Places where the script is centralized should have less of a problem, as the site-installed version can still be modified. The proper solution really is to move the site defaults out of the script itself and into... something else. We'll need to think about that before the next RBTools release. In time, we'll probably want to move some of the support classes in post-review out into a reusable library anyway, so it makes sense to install a package. It will also make it easier for us to unit test this. Note that this change looks larger than it is. post-review was renamed and moved from scripts/ to rbtools/. The only change made to the file was to make main() have no arguments (as needed by the wrapper script), so the reference to sys.argv[1:] was moved into main()'s body.
I posted this change with a fresh new RBTools package containing this change.