[DISCUSSION] Move to /src project layout
Our current code structure is:
├─ packagename
│ ├─ __init__.py
│ └─ ...
├─ tests
│ └─ ...
└─ setup.py
While this is valid it causes a problem in that the tests end up running against the source code not against the installed package (because run from the package root import deepforest sees the source code directory). This is currently causing two issues #562 and #531 (because it is blocking the fix in #739).
These sorts of problems are why an alternative structure is often recommended:
├─ src
│ └─ packagename
│ ├─ __init__.py
│ └─ ...
├─ tests
│ └─ ...
└─ setup.py
A couple of recommendations:
- https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure%3E
- https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#the-src-layout-and-testing
- https://hynek.me/articles/testing-packaging/
- Plus @ctb's group is using it which is generally good enough for me on its own
So, I'm opening this issue to have a discussion about whether we should move to a /src/deepforest/ structure in order to fix #562 and #531 and generally improve the robustness of our testing going forward be testing against the package as installed not the source code.