Skip to content

Commit 7875719

Browse files
authored
Merge pull request #1789 from polywrap/origin-0.10-dev
Prep Origin 0.10.5 | /workflows/release-pr
2 parents 0b86996 + 724c701 commit 7875719

13 files changed

Lines changed: 294 additions & 3195 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Polywrap Origin (0.10.5)
2+
## Bugs
3+
**`@polywrap/schema-bind`:**
4+
* [PR-1786](https://github.com/polywrap/cli/pull/1786) **Update `plugin/python` plugin bindings to latest client**
5+
16
# Polywrap Origin (0.10.4)
27
## Features
38
**`polywrap` CLI:**

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.4
1+
0.10.5

packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const HELP = `Usage: polywrap build|b [options]
1313
Build Polywrap Projects (type: interface, wasm)
1414
1515
Options:
16-
-m, --manifest-file <path> Path to the Polywrap Build manifest file
16+
-m, --manifest-file <path> Path to the Polywrap manifest file
1717
(default: polywrap.yaml | polywrap.yml)
1818
-o, --output-dir <path> Output directory for build results
1919
(default: ./build)

packages/js/cli/src/__tests__/commands.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,13 @@ const testData: CommandTestCaseData<CommandTypings> = {
225225
}],
226226
docs: {
227227
init: [{
228-
cwd: fs.mkdtempSync(path.join(os.tmpdir(), "docs-init")),
229-
before: async (test) => {
230-
if(!test.cwd)
231-
throw Error("This shouldn't happen");
232-
},
233-
after: (_, stdout, __, exitCode) => {
228+
cwd: path.join(GetPathToCliTestFiles(), "build-cmd/wasm/assemblyscript/001-sanity"),
229+
after: (test, stdout, __, exitCode) => {
234230
expect(stdout).toContain("Written docs manifest to");
235231
expect(exitCode).toBe(0);
232+
if (test.cwd) {
233+
fs.rmSync(path.join(test.cwd, "polywrap.docs.yaml"));
234+
}
236235
}
237236
}]
238237
}

packages/schema/bind/src/bindings/python/plugin/templates/module-py.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from typing import TypeVar, Generic, TypedDict, Optional
77

88
from .types import *
99

10-
from polywrap_core import InvokerClient, UriPackageOrWrapper
10+
from polywrap_core import InvokerClient
1111
from polywrap_plugin import PluginModule
1212
from polywrap_msgpack import GenericMap
1313

@@ -39,10 +39,10 @@ class Module(Generic[TConfig], PluginModule[TConfig]):
3939
{{#moduleType}}
4040
{{#methods}}
4141
@abstractmethod
42-
async def {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(
42+
def {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(
4343
self,
4444
args: Args{{#toUpper}}{{name}}{{/toUpper}},
45-
client: InvokerClient[UriPackageOrWrapper],
45+
client: InvokerClient,
4646
{{^env}}env: None{{/env}}{{#env}}env: {{^required}}Optional[{{/required}}Env{{^required}}] = None{{/required}}{{/env}}
4747
) -> {{#return}}{{#toPython}}{{toGraphQLType}}{{/toPython}}{{/return}}:
4848
pass

packages/schema/bind/src/bindings/python/plugin/templates/types-py.mustache

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ from __future__ import annotations
55
from typing import TypedDict, Optional
66
from enum import IntEnum
77

8-
from polywrap_core import InvokerClient, Uri, UriPackageOrWrapper
8+
from polywrap_core import InvokerClient, Uri
99
from polywrap_msgpack import GenericMap
1010

1111

@@ -100,16 +100,14 @@ class {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}(IntEn
100100
class {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}:
101101
{{#methods}}
102102
@staticmethod
103-
async def {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(
103+
def {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(
104104
args: {{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}},
105-
client: InvokerClient[UriPackageOrWrapper]
105+
client: InvokerClient
106106
) -> {{#return}}{{#toPython}}{{toGraphQLType}}{{/toPython}}{{/return}}:
107107
return client.invoke(
108-
InvokeOptions(
109-
uri=Uri.from_str("{{parent.uri}}"),
110-
method="{{name}}",
111-
args=args,
112-
)
108+
uri=Uri.from_str("{{parent.uri}}"),
109+
method="{{name}}",
110+
args=args,
113111
)
114112
{{^last}}
115113

@@ -127,17 +125,15 @@ class {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}:
127125
self.uri = uri
128126

129127
{{#methods}}
130-
async def {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(
128+
def {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(
131129
self,
132130
args: {{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}},
133-
client: InvokerClient[UriPackageOrWrapper]
131+
client: InvokerClient
134132
) -> {{#return}}{{#toPython}}{{toGraphQLType}}{{/toPython}}{{/return}}:
135133
return client.invoke(
136-
InvokeOptions(
137-
uri=self.uri,
138-
method="{{name}}",
139-
args=args,
140-
)
134+
uri=self.uri,
135+
method="{{name}}",
136+
args=args,
141137
)
142138
{{^last}}
143139

@@ -160,7 +156,7 @@ class {{#detectKeyword}}{{#toUpper}}{{namespace}}{{/toUpper}}{{/detectKeyword}}:
160156
{{#getImplementations}}
161157
{{#enabled}}
162158
def get_implementations(
163-
client: InvokerClient[UriPackageOrWrapper]
159+
client: InvokerClient
164160
) -> list[str]:
165161
impls = client.getImplementations(self.uri)
166162
return [impl.uri for impl in impls]
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
from hypothesis import given, strategies as st
22

3-
from polywrap_core import InvokeOptions
4-
53
from sample import sample_plugin
64

75
@given(st.text())
86
async def test_sample_method(s: str):
97
plugin = sample_plugin()
10-
wrapper = await plugin.create_wrapper()
11-
res = await wrapper.invoke(InvokeOptions(
8+
wrapper = plugin.create_wrapper()
9+
res = wrapper.invoke(
1210
uri="plugin/sample-plugin",
1311
method="sample_method",
1412
args={"data": s}
15-
), NotImplemented)
13+
)
1614

1715
assert not res.encoded
1816
assert res.result == f"{s} from sample_method"

0 commit comments

Comments
 (0)