I'm just now branching out into python packaging after using proprietary packaging methods for over a decade.
I have a data file that is used to generate python code that is a part of my package that runs on Windows and Linux. I'm trying to integrate it into my build process (tox / TravisCI) for generating my package and uploading to PyPI. Think of the data files as something similar to .proto
files for protobuf though the generator is written in python.
Options I've thought of but rejected
- Dynamically create objects by reading the data file at import time
- Con: Harder to debug the build process because you can't read the code
- Con: Limits the usefulness of static analysis (flake8, mypy)
- Check the generated code in (what I currently do)
- Con: More manual steps means more chances for making mistakes
- Con: Contributors missing the code-gen and modifying the generated output
Ideally, the solution would be easy for any of our Windows or Linux users to get up to speed on to remove barriers to contributing back.