-
About:
which generates .pyi/.py files in the following structure (note that it does not create any init.py files
Desire:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
You can use the include keyword if you want to do this as-is. But unfortunately that won't give you import-able python packages without the You can look at https://github.com/python-gnxi/python-gnmi-proto for an example how you could use betterproto to generate python code and then package it with Poetry. Note that the generation step is done outside of Poetry via the Makefile. |
Beta Was this translation helpful? Give feedback.
-
Alright having solved my problem I will document here for those encountering the same. If you are having issues packaging files generated by the standardproto compiler, the most likely issue you will be facing is that they are missing init.py's at each level of your python packages. In my case
In order to properly get these packaged use a script to drop an init.py at each level starting with [org_name]. After you have done that you can specify the following pyproject.toml which will correctly bundle the following. Note that this was run in a special folder that I copy the python files from above into so the structure looks like the following
The pyproject.toml will look like
The net result of which is that when installed this package will drop in <your_python_path>/site-packages/org_name/**/*.py files. Which if you refer to your python protos by their direct namespace should just work. |
Beta Was this translation helpful? Give feedback.
Alright having solved my problem I will document here for those encountering the same. If you are having issues packaging files generated by the standardproto compiler, the most likely issue you will be facing is that they are missing init.py's at each level of your python packages. In my case
In order to properly get these packaged use a script to drop an init.py at each level starting with [org_name]. After you have done that you can specify the follo…