I had a model.py file in a certain directory in the past, which was renamed.
If that file exists, the build fails, as the “proper” model.py exists in a separate directory.
Somehow it seems that a “zombie” version (in python those are usually .pyc files) of that file is there as I get an import error when running the tests:
File "/root/delta/transfers/action_controller.py", line 8, in <module> from models import Account ImportError: cannot import name Account
I am certain the Account class exists in in the “proper” models.py, as rebuilding disabling cache results in a successful build.
I already tried changing my
requirements.txt which forces a new cache to be created, but the problem somehow returned after a few builds.
The file models.py is not in any of the directories that are cached, so it shouldn’t affect the cache of future builds.
Is there a way I can guarantee there’s no .pyc files from previous builds in the container running my builds?