phenopacket-schema
phenopacket-schema copied to clipboard
Decide whether generated python code should be distributed on pypi
The readthedocs is an excellent intro to how to use the java code, what is the status of generated python? Is the java canonical? Sounds like some groups (cc @drseb ) are using generated python. Should we generate python and release on pypi with each release, or is that taking on too much?
The Python code is generated on each build along with the Java code. I've not used the Python, but it will follow the style in the protobuf Python docs i.e. it will follow Pythonic norms, not Java. I had considered releasing on pypi but after the maven central ordeal I left it as a thought...
@cmungall What would the best way be to do this from the Python ecosystem perspective? We can generate sufficient code for users to import protobuf or JSON (I think) serializations of the Phenopacket. In Java, it seems to be more idiomatic to generate that code from the protobuf schema using maven etc rather than distributing the Java classes. This seems to be different in the Python world -- is that correct?
@cmungall btw it seems difficult to import the correct python packet to get any of this to work. These classes require the google.protobuf class but I cannot figure out how to actually install and import it. Google does not seem to be supporting python (much). Have you got this to run?
@julesjacobsen reports having generated the python correctly..
Releasing to pypi is a dream compared to maven central. Nevertheless I can appreciate the overhead for each release having to release two places, using two toolchains. We could potentially distribute this work to more pythonic members of the team, at the cost of some asynchrony between releases. If we want to sync github releases too then that is additional faffing. In theory it should be possible to automate all of this so the release manager just runs a single command..
Tip for pypi - I've found it's easiest to just go with a READMD.rst rather than faffing around with conversion from md
.rst should be the standard anyway!
I've made some progress towards this, but there are still a few more steps to go through to fully-automate the whole thing.
https://packaging.python.org/tutorials/packaging-projects/
@iimpulse @julesjacobsen Mike is now ready to submit a Python package to PyPI. Can we touch bases before we finalize?
The issue can be closed when #384 is merged.