I'm not too familiar with Flask. Can you post the ...
# general
I'm not too familiar with Flask. Can you post the error you're getting? I assume
has a
function that is its entry point?
i just started digging into this more, I was kinda hoping maybe someone was familiar with this
it looks like when running in development mode, flask is trying to do some magic to restart the application...i might have to dig into flask code to know more
but basically...
Copy code
$ FLASK_ENV=development FLASK_APP=jumio.services.fawrensian.apps.mesos.flask-app.py ./pants run src/python/jumio/services/fawrensian/apps/mesos:flask -- run
22:27:49.31 [INFO] initializing pantsd...
22:27:50.11 [INFO] pantsd initialized.
 * Tip: There are .env or .flaskenv files present. Do "pip install python-dotenv" to use them.
 * Serving Flask app "jumio.services.fawrensian.apps.mesos.flask-app.py" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on <> (Press CTRL+C to quit)
 * Restarting with stat
/home/jrloc/.pyenv/versions/3.8.5/bin/python3.8: No module named flask
the "no module named ..." part with the name of the target (i've called it "local", "devel", etc...i think it's the flask dev server reloader, seems like a bug to follow up with on their side
Oh interesting, this might be similar to the issues I've had with running the Django dev server. It too does some magic to restart itself
It watches the filesystem and restarts on changes, and the way it restarts itself doesn't play nicely with pex.
So I was turning that auto-restart feature off
And was planning to write a Pants plugin for Django that does the reloading for you (since Pants already watches the filesystem, and also knows about files that Django doesn't, like .proto sources)
But to support this sort of thing more generally we may want a "run this directly in the local source tree, not in a chroot" flag
With all the relevant warnings and caveats about the lack of hermeticity...
how would you do this? just package the deps and entry point in a pex and run it with
pointing at the source roots?