File tree 4 files changed +8
-119
lines changed
4 files changed +8
-119
lines changed Original file line number Diff line number Diff line change 4
4
import os
5
5
from typing import List , Optional
6
6
7
- from dosei_util import dosei_util
8
7
from croniter import croniter
9
8
from pydantic import BaseModel , field_validator
10
9
@@ -60,7 +59,3 @@ def is_func_async(func) -> bool:
60
59
def call_func (func ):
61
60
is_async = Dosei .is_func_async (func )
62
61
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 )
Original file line number Diff line number Diff line change 1
1
import os
2
2
import sys
3
3
4
- import click
5
-
6
4
from dosei import Dosei
7
5
from dosei .importer import import_from_string , ImportFromStringError
8
6
12
10
sys .path .insert (0 , "" )
13
11
14
12
15
- @click .group ()
16
- def cli ():
17
- pass
18
-
19
- def _run (func ):
13
+ def run (func ):
20
14
if func :
21
15
return Dosei .call_func (import_from_string (func ))
22
16
try :
23
17
app : Dosei = import_from_string (dosei_config_init )
24
18
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 ()} \" " )
26
20
if app .command is None :
27
- raise click . ClickException ('Command "run" not found.' )
21
+ raise ImportFromStringError ('Command "run" not found.' )
28
22
os .system (app .command )
29
23
30
- @cli .command ()
31
- @click .argument ("func" , required = False )
32
- def run (func ):
33
- _run (func )
34
24
35
- @cli .command ()
36
25
def dev ():
37
26
try :
38
27
app : Dosei = import_from_string (dosei_config_init )
39
28
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 ()} \" " )
41
30
if app .dev is None :
42
- raise click . ClickException ('Command "dev" not found.' )
31
+ raise ImportFromStringError ('Command "dev" not found.' )
43
32
os .system (app .dev )
44
33
45
34
46
- @cli .command ()
47
35
def export ():
48
36
try :
49
37
app : Dosei = import_from_string (dosei_config_init )
50
38
return app .export ()
51
39
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 ()} \" " )
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " dosei"
3
- version = " 0.0.18a7 "
3
+ version = " 0.0.18a8 "
4
4
description = " Dosei Python SDK"
5
5
authors = [
" Alvaro Molina <[email protected] >" ]
6
6
license = " Apache-2.0"
@@ -13,10 +13,8 @@ dosei = 'dosei.main:cli'
13
13
python = " ^3.11"
14
14
fastapi = " ^0.109.2"
15
15
pytest-trio = " ^0.8.0"
16
- click = " ^8.1.7"
17
16
croniter = " ^2.0.1"
18
17
pydantic = " ^2.6.1"
19
- dosei-util = " ^0.0.13"
20
18
21
19
22
20
[tool .poetry .group .dev .dependencies ]
You can’t perform that action at this time.
0 commit comments