-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more Flask entrypoints #733
base: main
Are you sure you want to change the base?
Allow more Flask entrypoints #733
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add integration tests for the following use cases:
- app variable inside one of the allowed entrypoint files other than the default app.py
- same as above but the file that has the app variable is excluded in
prime
list
{"src": "flask/app/src", "migrate.sh": "flask/app/migrate.sh"}, | ||
"/bin/python3 -m gunicorn -c /flask/gunicorn.conf.py src.app:app", | ||
id="Include other files beside the entrypoint", | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add unit tests for the other use-cases like src/main.py
, src/__init__.py
, foo_bar/main.py
and foo_bar/__init__.py
?
Currently for Flask the
app
global variables has to be in the fileapp.py
in the base project directory.This PR allows more possible places for entry points, following what is done in the FastAPI framework.
The app variable for the
WSGI
entrypoint will be searched in:app.py
file in the base directorymain.py
file in the base directory__init__.py
,app.py
ormain.py
:a.
app
directory.b.
src
directory.c. A directory with the same name as the project.