-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Implement Python wrapper for parity-clib and example #10443
Conversation
It looks like @mjkoo signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
@@ -14,6 +14,7 @@ futures = "0.1.6" | |||
jni = { version = "0.11", optional = true } | |||
panic_hook = { path = "../util/panic-hook" } | |||
parity-ethereum = { path = "../", default-features = false } | |||
pyo3 = { version = "0.6.0-alpha.4", optional = true, features = ["extension-module"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyo3
will require the nightly toolchain and currently we only use stable features
""" | ||
cb = _CallbackGenerator() | ||
self.rpc_query_cb(query, cb, timeout_ms) | ||
return next(cb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will call the iterator of the Callback class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of the _CallbackGenerator
class, yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks very good and clean thank you. Added some minor comments/questions that needs to be addressed.
However, because we don't allow unstable
features we need to wait until version 0.6
is available, PyO3/pyo3#210.
The latest nightly don't work on parity
due to ICE so I couldn't test it
@niklasad1 thank you for review, partially addressed comments, had some follow up questions asked above. Also experienced ICE when compiling with latest nightly, had to revert to nightly-2019-02-07 which is what I've been testing with. Ack re: pyo3 and stable features, especially since this is triggering bug with current nightly toolchain. Will follow stabilization efforts over there, seems fairly close. |
FYI, the ICE is fixed now rust-lang/rust#58634 |
I would love to get it in. What is the status of this pr? @niklasad1 do you still have some suggestions regarding this pr? |
I would love to get it in. What is the status of this pr? @niklasad1 do you still have some suggestions regarding this pr? |
@debris it is currently blocked on PyO3/pyo3#210 but I agree would be nice to get it in. We shall maybe look how hard it to fix that issue IMHO. |
We have removed the |
Follows
jni
example, usespyo3
to build an extension module exposing the low-level API and includes a Python module which exports a more pythonic interface.Ref: #9339 and #8604
Interested in also tackling #9338 (Golang example) if this is well-received.