这是indexloc提供的服务,不要输入任何密码
Skip to content

Improve openbb api launcher #7060

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

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

piiq
Copy link
Member

@piiq piiq commented Mar 12, 2025

This PR changes the import_app function to accommodate the following cases:

openbb-api --app my_module.main:app
openbb-api --app main.py:app
openbb-api --app my_folder/main.py:app
openbb-api --app main.py --name another_name
openbb-api --app my_module.main:create_app
openbb-api --app main:create_app --factory

and others.

So now the launcher can handle python modules, sub-modules, relative paths, absolute paths.
The factory launcher now uses similar logic to what uvicorn uses to detect the factory allows us to stop relying on explicit type annotation of the factory function.

Additinonally some tests for import_app were added, although 2/3 of them actually work

@piiq piiq added the v4 PRs for v4 label Mar 12, 2025
@piiq piiq requested a review from deeleeramone March 12, 2025 14:28
@github-actions github-actions bot added enhancement Enhancement platform OpenBB Platform labels Mar 12, 2025
@deeleeramone deeleeramone added this pull request to the merge queue Mar 13, 2025
Merged via the queue into develop with commit 1a86791 Mar 13, 2025
10 checks passed
@piiq piiq deleted the feature/improve-openbb-api-launching-apis branch March 29, 2025 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants