I've created a repo https://github.com/martyanov/riak_pb_precompiled based on a PYPI riak_pb version 1.2.1 and removed unnecessary stuff to demonstrate what I mean.
I think protoc and build hooks are useful only during development.
Would it be possible to convert that into some steps that would provide an sdist tarball that includes the precompiled proto files for pypi?
You already have the working machinery. I'm just proposing to split the package building into two separate steps:
1. Use proto_cmd.py as a separate executable, remove cmdclass from setup.py;
2. Build a tarball, we should remove MANIFEST.IN to exclude unnecessary protobuf sources and proto_cmd.py;
3. Edit Makefile.
I use the proposed repository to install riak-python-client on Heroku, because protoc installation really complicates the deployment.
I've just created pull request with a possible solution. Please see #37.
It's the easiest working solution, but may be it's better to refactor proto_cmd.py, now it looks like a dirty hack.
Remove need to have protoc available in Python source package. Closes #…