|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -from typing import Any, List, Optional, Protocol |
| 15 | +from typing import Any, List, Optional, Protocol, TYPE_CHECKING |
| 16 | +from warings import deprecated |
16 | 17 |
|
17 | 18 |
|
18 | 19 | class CanExecuteScripts(Protocol): |
19 | 20 | def execute_script(self, script: str, *args: Any) -> Any: ... |
20 | 21 |
|
21 | | - # TODO: Implement them later |
22 | | - # def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ... |
23 | | - # def unpin(self, script_key: Any) -> None: ... |
24 | | - # def get_pinned_scripts(self) -> List[str]: ... |
25 | | - # def execute_async_script(self, script: str, *args: Any) -> Any: ... |
| 22 | + # TODO: remove `if not TYPE_CHECKING` guard after properly implement them |
| 23 | + # The use of these methods will produce DeprecationWarnings at runtime |
| 24 | + if not TYPE_CHECKING: |
| 25 | + @deprecated("pin_script is not yet implemented") |
| 26 | + def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ... |
| 27 | + |
| 28 | + @deprecated("unpin is not yet implemented") |
| 29 | + def unpin(self, script_key: Any) -> None: ... |
| 30 | + |
| 31 | + @deprecated("get_pinned_scripts is not yet implemented") |
| 32 | + def get_pinned_scripts(self) -> List[str]: ... |
| 33 | + |
| 34 | + @deprecated("execute_async_script is not yet implemented") |
| 35 | + def execute_async_script(self, script: str, *args: Any) -> Any: ... |
0 commit comments