Fix packaging by rpkilby · Pull Request #5624 · encode/django-rest-framework (original) (raw)

I've punted on moving the package under a src directory, and just made the minimum necessary changes. Also, fixes #5615.


I don't know if we want to accept this as is, given that I moved the package contents into a src directory. If we're willing to accept that change, the move is for a good reason. tox does create and install the package distribution into the test environment, however this conflicts with the rest_framework package that's located on the current path. Because the distribution and local files conflict, you cannot effectively test the distribution's packaged files. eg, the distribution may not be correctly configured (missing templates/static files), but the files on the local path do have them, so the tests pass erroneously.

The solution is to move the package off of the path (usually into a src directory), so that the local files are not importable.

The alternative would be to not move the package into src and accept that we may accidentally leave out files from time to time. This is probably fine, given that the manifest won't change very often.