From 5cabe5d9d1f4aafb8fe74fbeb1fa5532e9b47542 Mon Sep 17 00:00:00 2001 From: Niraj Kamdar Date: Tue, 15 Aug 2023 00:20:23 +0530 Subject: [PATCH] fix: readthedocs config fix fix: config fix: issue fix: issues --- .readthedocs.yaml | 2 +- docs/source/conf.py | 12 +- .../plugins/polywrap-http-plugin/.gitignore | 3 +- .../polywrap_http_plugin/wrap/__init__.py | 6 - .../polywrap_http_plugin/wrap/module.py | 53 --- .../polywrap_http_plugin/wrap/types.py | 73 ---- .../polywrap_http_plugin/wrap/wrap_info.py | 356 ------------------ 7 files changed, 11 insertions(+), 494 deletions(-) delete mode 100644 packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/__init__.py delete mode 100644 packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/module.py delete mode 100644 packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/types.py delete mode 100644 packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/wrap_info.py diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 7ab672fa..9b1033b9 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,7 +11,7 @@ build: tools: python: "3.10" # You can also specify other tool versions: - # nodejs: "19" + nodejs: "18" # rust: "1.64" # golang: "1.19" jobs: diff --git a/docs/source/conf.py b/docs/source/conf.py index ec6ff066..c69e1f00 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -42,13 +42,17 @@ root_dir = os.path.join(os.path.dirname(__file__), "..", "..") -sys_config_dir = os.path.join(root_dir, "packages", "config-bundles", "polywrap-sys-config-bundle") -subprocess.check_call(["yarn", "codegen"], cwd=sys_config_dir) +fs_plugin_dir = os.path.join(root_dir, "packages", "plugins", "polywrap-fs-plugin") +http_plugin_dir = os.path.join(root_dir, "packages", "plugins", "polywrap-http-plugin") +ethereum_plugin_dir = os.path.join(root_dir, "packages", "plugins", "polywrap-ethereum-provider") + +subprocess.check_call(["npm", "install", "-g", "yarn"], cwd=root_dir) +subprocess.check_call(["yarn", "codegen"], cwd=fs_plugin_dir) +subprocess.check_call(["yarn", "codegen"], cwd=http_plugin_dir) +subprocess.check_call(["yarn", "codegen"], cwd=ethereum_plugin_dir) shutil.rmtree(os.path.join(root_dir, "docs", "source", "misc"), ignore_errors=True) shutil.copytree(os.path.join(root_dir, "misc"), os.path.join(root_dir, "docs", "source", "misc")) -subprocess.check_call(["python", "scripts/extract_readme.py"], cwd=os.path.join(root_dir, "packages", "polywrap-client")) shutil.copy2(os.path.join(root_dir, "packages", "polywrap-client", "README.rst"), os.path.join(root_dir, "docs", "source", "Quickstart.rst")) - shutil.copy2(os.path.join(root_dir, "CONTRIBUTING.rst"), os.path.join(root_dir, "docs", "source", "CONTRIBUTING.rst")) diff --git a/packages/plugins/polywrap-http-plugin/.gitignore b/packages/plugins/polywrap-http-plugin/.gitignore index b5048d73..fb04f28b 100644 --- a/packages/plugins/polywrap-http-plugin/.gitignore +++ b/packages/plugins/polywrap-http-plugin/.gitignore @@ -2,4 +2,5 @@ **/.pytest_cache/ **/dist/ **/node_modules/ -**/.tox/ \ No newline at end of file +**/.tox/ +wrap/ \ No newline at end of file diff --git a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/__init__.py b/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/__init__.py deleted file mode 100644 index d2ad6b37..00000000 --- a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore - -from .types import * -from .module import * -from .wrap_info import * diff --git a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/module.py b/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/module.py deleted file mode 100644 index 7e038704..00000000 --- a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/module.py +++ /dev/null @@ -1,53 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore -from __future__ import annotations - -from abc import abstractmethod -from typing import TypeVar, Generic, TypedDict, Optional - -from .types import * - -from polywrap_core import InvokerClient -from polywrap_plugin import PluginModule -from polywrap_msgpack import GenericMap - -TConfig = TypeVar("TConfig") - - -ArgsGet = TypedDict("ArgsGet", { - "url": str, - "request": Optional["Request"] -}) - -ArgsPost = TypedDict("ArgsPost", { - "url": str, - "request": Optional["Request"] -}) - - -class Module(Generic[TConfig], PluginModule[TConfig]): - def __new__(cls, *args, **kwargs): - # NOTE: This is used to dynamically add WRAP ABI compatible methods to the class - instance = super().__new__(cls) - setattr(instance, "get", instance.get) - setattr(instance, "post", instance.post) - return instance - - @abstractmethod - def get( - self, - args: ArgsGet, - client: InvokerClient, - env: None - ) -> Optional["Response"]: - pass - - @abstractmethod - def post( - self, - args: ArgsPost, - client: InvokerClient, - env: None - ) -> Optional["Response"]: - pass - diff --git a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/types.py b/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/types.py deleted file mode 100644 index 11d4a119..00000000 --- a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/types.py +++ /dev/null @@ -1,73 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore -from __future__ import annotations - -from typing import TypedDict, Optional -from enum import IntEnum - -from polywrap_core import InvokerClient, Uri -from polywrap_msgpack import GenericMap - - -### Env START ### - -### Env END ### - -### Objects START ### - -Response = TypedDict("Response", { - "status": int, - "statusText": str, - "headers": Optional[GenericMap[str, str]], - "body": Optional[str], -}) - -Request = TypedDict("Request", { - "headers": Optional[GenericMap[str, str]], - "urlParams": Optional[GenericMap[str, str]], - "responseType": "ResponseType", - "body": Optional[str], - "formData": Optional[list["FormDataEntry"]], - "timeout": Optional[int], -}) - -FormDataEntry = TypedDict("FormDataEntry", { - "name": str, - "value": Optional[str], - "fileName": Optional[str], - "type": Optional[str], -}) - -### Objects END ### - -### Enums START ### -class ResponseType(IntEnum): - TEXT = 0, "0", "TEXT" - BINARY = 1, "1", "BINARY" - - def __new__(cls, value: int, *aliases: str): - obj = int.__new__(cls) - obj._value_ = value - for alias in aliases: - cls._value2member_map_[alias] = obj - return obj - -### Enums END ### - -### Imported Objects START ### - -### Imported Objects END ### - -### Imported Enums START ### - - -### Imported Enums END ### - -### Imported Modules START ### - -### Imported Modules END ### - -### Interface START ### - - -### Interface END ### diff --git a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/wrap_info.py b/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/wrap_info.py deleted file mode 100644 index 3efb1980..00000000 --- a/packages/plugins/polywrap-http-plugin/polywrap_http_plugin/wrap/wrap_info.py +++ /dev/null @@ -1,356 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore -from __future__ import annotations - -import json - -from polywrap_manifest import WrapManifest - -abi = json.loads(""" -{ - "enumTypes": [ - { - "constants": [ - "TEXT", - "BINARY" - ], - "kind": 8, - "type": "ResponseType" - } - ], - "moduleType": { - "kind": 128, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "url", - "required": true, - "scalar": { - "kind": 4, - "name": "url", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "request", - "object": { - "kind": 8192, - "name": "request", - "type": "Request" - }, - "type": "Request" - } - ], - "kind": 64, - "name": "get", - "required": true, - "return": { - "kind": 34, - "name": "get", - "object": { - "kind": 8192, - "name": "get", - "type": "Response" - }, - "type": "Response" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "url", - "required": true, - "scalar": { - "kind": 4, - "name": "url", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "request", - "object": { - "kind": 8192, - "name": "request", - "type": "Request" - }, - "type": "Request" - } - ], - "kind": 64, - "name": "post", - "required": true, - "return": { - "kind": 34, - "name": "post", - "object": { - "kind": 8192, - "name": "post", - "type": "Response" - }, - "type": "Response" - }, - "type": "Method" - } - ], - "type": "Module" - }, - "objectTypes": [ - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "status", - "required": true, - "scalar": { - "kind": 4, - "name": "status", - "required": true, - "type": "Int" - }, - "type": "Int" - }, - { - "kind": 34, - "name": "statusText", - "required": true, - "scalar": { - "kind": 4, - "name": "statusText", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "headers", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "headers", - "scalar": { - "kind": 4, - "name": "headers", - "required": true, - "type": "String" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "headers", - "required": true, - "type": "String" - } - }, - "name": "headers", - "type": "Map" - }, - { - "kind": 34, - "name": "body", - "scalar": { - "kind": 4, - "name": "body", - "type": "String" - }, - "type": "String" - } - ], - "type": "Response" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "headers", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "headers", - "scalar": { - "kind": 4, - "name": "headers", - "required": true, - "type": "String" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "headers", - "required": true, - "type": "String" - } - }, - "name": "headers", - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "urlParams", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "urlParams", - "scalar": { - "kind": 4, - "name": "urlParams", - "required": true, - "type": "String" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "urlParams", - "required": true, - "type": "String" - } - }, - "name": "urlParams", - "type": "Map" - }, - { - "enum": { - "kind": 16384, - "name": "responseType", - "required": true, - "type": "ResponseType" - }, - "kind": 34, - "name": "responseType", - "required": true, - "type": "ResponseType" - }, - { - "comment": "The body of the request. If present, the `formData` property will be ignored.", - "kind": 34, - "name": "body", - "scalar": { - "kind": 4, - "name": "body", - "type": "String" - }, - "type": "String" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "formData", - "required": true, - "type": "FormDataEntry" - }, - "kind": 18, - "name": "formData", - "object": { - "kind": 8192, - "name": "formData", - "required": true, - "type": "FormDataEntry" - }, - "type": "[FormDataEntry]" - }, - "comment": " An alternative to the standard request body, 'formData' is expected to be in the 'multipart/form-data' format.\\nIf present, the `body` property is not null, `formData` will be ignored.\\nOtherwise, if formData is not null, the following header will be added to the request: 'Content-Type: multipart/form-data'.", - "kind": 34, - "name": "formData", - "type": "[FormDataEntry]" - }, - { - "kind": 34, - "name": "timeout", - "scalar": { - "kind": 4, - "name": "timeout", - "type": "UInt32" - }, - "type": "UInt32" - } - ], - "type": "Request" - }, - { - "kind": 1, - "properties": [ - { - "comment": "FormData entry key", - "kind": 34, - "name": "name", - "required": true, - "scalar": { - "kind": 4, - "name": "name", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "comment": "If 'type' is defined, value is treated as a base64 byte string", - "kind": 34, - "name": "value", - "scalar": { - "kind": 4, - "name": "value", - "type": "String" - }, - "type": "String" - }, - { - "comment": "File name to report to the server", - "kind": 34, - "name": "fileName", - "scalar": { - "kind": 4, - "name": "fileName", - "type": "String" - }, - "type": "String" - }, - { - "comment": "MIME type (https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). Defaults to empty string.", - "kind": 34, - "name": "type", - "scalar": { - "kind": 4, - "name": "type", - "type": "String" - }, - "type": "String" - } - ], - "type": "FormDataEntry" - } - ], - "version": "0.1" -} -""") - -manifest = WrapManifest.parse_obj({ - "name": "Http", - "type": "plugin", - "version": "0.1", - "abi": abi, -})