-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: `dosei run` feat: `dosei dev`
- Loading branch information
Showing
10 changed files
with
282 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "dosei" | ||
version = "0.0.17" | ||
version = "0.0.18a1" | ||
description = "Dosei Python SDK" | ||
authors = ["Alvaro Molina <[email protected]>"] | ||
license = "Apache-2.0" | ||
|
@@ -11,12 +11,12 @@ dosei = 'dosei.main:cli' | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
fastapi = "^0.104.1" | ||
fastapi = "^0.109.2" | ||
pytest-trio = "^0.8.0" | ||
click = "^8.1.7" | ||
croniter = "^2.0.1" | ||
pydantic = "^2.5.1" | ||
dosei-util = "^0.0.1" | ||
pydantic = "^2.6.1" | ||
dosei-util = "^0.0.13" | ||
|
||
|
||
[tool.poetry.group.dev.dependencies] | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import os | ||
from dosei import Dosei | ||
|
||
port = os.getenv('PORT', 8080) | ||
dosei = Dosei( | ||
name="hello-world", | ||
command=f"uvicorn helloworld.main:app --host 0.0.0.0 --port {port}", | ||
dev=f"uvicorn tests.fastapi.helloworld.main:app --port {port} --reload", | ||
port=port | ||
) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from typing import Union | ||
|
||
from fastapi import FastAPI | ||
|
||
app = FastAPI() | ||
|
||
|
||
@app.get("/") | ||
def read_root(): | ||
return {"Hello": "World"} | ||
|
||
|
||
@app.get("/items/{item_id}") | ||
def read_item(item_id: int, q: Union[str, None] = None): | ||
return {"item_id": item_id, "q": q} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from dosei import Dosei | ||
from dosei.importer import import_from_string | ||
|
||
|
||
def test_fastapi(): | ||
app: Dosei = import_from_string("tests.fastapi.dosei:dosei") | ||
assert app.name == "hello-world" | ||
assert app.port == 8080 | ||
assert app.command == "uvicorn helloworld.main:app --host 0.0.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters