Package Data

Published on Oct. 5, 2022 | Tags: python packaging TIL

Yesterday, I released django-interactive-models and when I tried it in another project to try it out installing it through pip and all that, I got an error saying the template file did not exist.


Fortunately, I had watched this video where Anthony talks about packging data with your python wheel. And this was easily solved by checking setuptools, the build system I use for this project: setuptools docs. I ended up adding:


[tool.setuptools.package-data]
interactive_models = ["templates/*"]

in this commit. I am happy I had watched this video before otherwise I wouldn't have known what was wrong!


Ferran Jovell