MartinHeinz/python-project-blueprint

Consider src directory

Opened this issue · 1 comments

Consider using a src directory. This facilitates running tests against what is actually installed.

https://hynek.me/articles/testing-packaging/

I have been bitten by this. I've had tests pass locally but fail within a .whl file. I've had them pass in a .whl file and fail in a source tgz file. This typically happens when you start needing to ship non-python files. Configuration, images, documents, templates, etc.

Thanks for the suggestion.

This project setup is assuming that you are building, running, testing... your app using Docker containers. If that's the case then you should not run into issues you described. There's also tests/context.py file that allows you to tweak context of your tests, if you have any issues.

I've been using this layout for a while and I haven't run into any problems with test runs, so I'm inclined to keep it the simple way (as it is now).