|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -import importlib.util |
16 | 15 | import json |
17 | 16 | import time |
18 | 17 |
|
@@ -59,36 +58,6 @@ def __init__(self, access_key: str, secret_key: str, region: str = "cn-beijing") |
59 | 58 |
|
60 | 59 | self.template_id = "6874f3360bdbc40008ecf8c7" |
61 | 60 |
|
62 | | - def _pre_check(self, path: str): |
63 | | - if not path.exists(): |
64 | | - raise ValueError(f"Path {path} does not exist.") |
65 | | - |
66 | | - index_py_path = path / "index.py" |
67 | | - if not index_py_path.exists(): |
68 | | - raise ValueError( |
69 | | - "The project directory must include the `index.py` file. See: https://www.volcengine.com/docs/6662/107432" |
70 | | - ) |
71 | | - typer.echo( |
72 | | - typer.style( |
73 | | - "Check `index.py` file pass.", |
74 | | - fg=typer.colors.BRIGHT_BLACK, |
75 | | - ), |
76 | | - ) |
77 | | - |
78 | | - spec = importlib.util.spec_from_file_location("index", index_py_path) |
79 | | - module = importlib.util.module_from_spec(spec) |
80 | | - spec.loader.exec_module(module) |
81 | | - if not (hasattr(module, "handler") and callable(module.handler)): |
82 | | - raise ValueError( |
83 | | - "The `index.py` file must include a `handler` function. See: https://www.volcengine.com/docs/6662/107432" |
84 | | - ) |
85 | | - typer.echo( |
86 | | - typer.style( |
87 | | - "Check `handler` function pass.", |
88 | | - fg=typer.colors.BRIGHT_BLACK, |
89 | | - ), |
90 | | - ) |
91 | | - |
92 | 61 | def _create_function(self, name: str, path: str): |
93 | 62 | function_name = f"{name}-fn-{formatted_timestamp()}" |
94 | 63 |
|
@@ -168,9 +137,6 @@ def _create_function(self, name: str, path: str): |
168 | 137 |
|
169 | 138 | return function_name, function_id |
170 | 139 |
|
171 | | - def _get_template(self): |
172 | | - pass |
173 | | - |
174 | 140 | def _create_application( |
175 | 141 | self, |
176 | 142 | application_name: str, |
|
0 commit comments