Skip to content
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

Fix module name in running the app instructions in v3.rst #1948

Open
chrisinmtown opened this issue Jul 17, 2024 · 2 comments
Open

Fix module name in running the app instructions in v3.rst #1948

chrisinmtown opened this issue Jul 17, 2024 · 2 comments

Comments

@chrisinmtown
Copy link

chrisinmtown commented Jul 17, 2024

Description

I'm trying to migrate from v2 to v3, and started by reading https://connexion.readthedocs.io/en/latest/v3.html

The section "Running the application" shows a file named hello.py with this content:

import connexion

app = connexion.App(__name__)

if __name__ == "__main__":
    app.run()

Then instructs me to issue one of these commands to run the application:

$ uvicorn run:app
$ gunicorn -k uvicorn.workers.UvicornWorker run:app

I think these should read:

$ uvicorn hello:app
$ gunicorn -k uvicorn.workers.UvicornWorker hello:app

Expected behaviour

The app starts with the expected output:

% uvicorn hello:app
INFO:     Started server process [21732]
INFO:     Waiting for application startup.
INFO:     ASGI 'lifespan' protocol appears unsupported.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

Actual behaviour

The module "run" is not found:

% uvicorn run:app
ERROR:    Error loading ASGI app. Could not import module "run"

Steps to reproduce

  • pip install connexion[flask]
  • create file hello.py with content shown above
  • issue command uvicorn run:app

Additional info:

% python --version
Python 3.11.9
% pip show connexion | grep "^Version\:"
Version: 2.14.2

My current employer makes me jump thru many hoops before I can contribute a pull request, so that might not be forthcoming right away.

Look, I realize this bug is trivial. Still the complexity of migrating this app is large, and when the very first step doesn't work, it is frustrating.

Thanks for listening.

@chrisinmtown
Copy link
Author

Here's the diff of the change I propose:

% git diff v3.rst
diff --git a/docs/v3.rst b/docs/v3.rst
index 260b9e1..9d34526 100644
--- a/docs/v3.rst
+++ b/docs/v3.rst
@@ -94,11 +94,11 @@ Instead, you need to run the Connexion application using an ASGI server:
 
 .. code-block:: bash
 
-    $ uvicorn run:app
+    $ uvicorn hello:app
 
 .. code-block:: bash
 
-    $ gunicorn -k uvicorn.workers.UvicornWorker run:app
+    $ gunicorn -k uvicorn.workers.UvicornWorker hello:app
 
 .. warning::

@chrisinmtown
Copy link
Author

chrisinmtown commented Aug 29, 2024

Greetings to the connexion team, I opened this about 6 weeks ago and provided code (at least a diff). I sure was hoping to get some kind of response. Please say, what is the status of this project and the new maintainers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant