Skip to content

Commit 81890af

Browse files
committed
0.0.18a8
1 parent 183c999 commit 81890af

File tree

4 files changed

+8
-119
lines changed

4 files changed

+8
-119
lines changed

dosei/app.py

-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os
55
from typing import List, Optional
66

7-
from dosei_util import dosei_util
87
from croniter import croniter
98
from pydantic import BaseModel, field_validator
109

@@ -60,7 +59,3 @@ def is_func_async(func) -> bool:
6059
def call_func(func):
6160
is_async = Dosei.is_func_async(func)
6261
return asyncio.run(func()) if is_async else func()
63-
64-
@staticmethod
65-
def find_init(folder_path: str) -> str:
66-
return dosei_util.find_framework_init("Dosei", folder_path)

dosei/main.py

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
22
import sys
33

4-
import click
5-
64
from dosei import Dosei
75
from dosei.importer import import_from_string, ImportFromStringError
86

@@ -12,41 +10,31 @@
1210
sys.path.insert(0, "")
1311

1412

15-
@click.group()
16-
def cli():
17-
pass
18-
19-
def _run(func):
13+
def run(func):
2014
if func:
2115
return Dosei.call_func(import_from_string(func))
2216
try:
2317
app: Dosei = import_from_string(dosei_config_init)
2418
except ImportFromStringError:
25-
raise click.ClickException(f"Couldn't find a dosei_config.py file in \"{os.getcwd()}\"")
19+
raise ImportFromStringError(f"Couldn't find a dosei_config.py file in \"{os.getcwd()}\"")
2620
if app.command is None:
27-
raise click.ClickException('Command "run" not found.')
21+
raise ImportFromStringError('Command "run" not found.')
2822
os.system(app.command)
2923

30-
@cli.command()
31-
@click.argument("func", required=False)
32-
def run(func):
33-
_run(func)
3424

35-
@cli.command()
3625
def dev():
3726
try:
3827
app: Dosei = import_from_string(dosei_config_init)
3928
except ImportFromStringError:
40-
raise click.ClickException(f"Couldn't find a dosei_config.py file in \"{os.getcwd()}\"")
29+
raise ImportFromStringError(f"Couldn't find a dosei_config.py file in \"{os.getcwd()}\"")
4130
if app.dev is None:
42-
raise click.ClickException('Command "dev" not found.')
31+
raise ImportFromStringError('Command "dev" not found.')
4332
os.system(app.dev)
4433

4534

46-
@cli.command()
4735
def export():
4836
try:
4937
app: Dosei = import_from_string(dosei_config_init)
5038
return app.export()
5139
except ImportFromStringError:
52-
raise click.ClickException(f"Couldn't find a dosei_config.py file in \"{os.getcwd()}\"")
40+
raise ImportFromStringError(f"Couldn't find a dosei_config.py file in \"{os.getcwd()}\"")

poetry.lock

+1-93
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dosei"
3-
version = "0.0.18a7"
3+
version = "0.0.18a8"
44
description = "Dosei Python SDK"
55
authors = ["Alvaro Molina <[email protected]>"]
66
license = "Apache-2.0"
@@ -13,10 +13,8 @@ dosei = 'dosei.main:cli'
1313
python = "^3.11"
1414
fastapi = "^0.109.2"
1515
pytest-trio = "^0.8.0"
16-
click = "^8.1.7"
1716
croniter = "^2.0.1"
1817
pydantic = "^2.6.1"
19-
dosei-util = "^0.0.13"
2018

2119

2220
[tool.poetry.group.dev.dependencies]

0 commit comments

Comments
 (0)