basho/riak_pb — pull request #17 by blowery (2012-09-12 16:33:10+00:00)
Title: move proto_cmd.py into the setup.py, hard-code version so that sdist can...

This allows a sdist, used by pip, to work as expected.

Couple weird bits:
* It hard-codes the version in setup.py instead of pulling it from the protobuf app spec. setup.py is run in two contexts with pip, one by the maintainer looking to create the distribution and one by the consumer looking to install the package. Both need access to the version, but only the maintainer should be able to see the app.src file which holds the version. Hard-coding the version in setup.py works around that problem.
* I moved the guts of proto_cmd.py inside setup.py because there doesn't appear to be a good way to distribute helper modules for setup.py without installing them as full-on scripts. Moving the guts into setup.py allows the maintainer and the consumer to use setup.py without issue.

Going forward, to push a package that supports pip, the maintainer would have to do:
python setup.py build sdist upload