Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: python workflows #892

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
65 changes: 65 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
"src/typegate/standalone",
"src/typegraph/core",
"src/xtask",
"src/substantial"
"src/substantial",
]

exclude = [
Expand Down Expand Up @@ -69,19 +69,19 @@ sha2 = "0.10.8"
seahash = "4.1.0"

# patterns
anyhow = "1.0.89" # FIXME: replace anyhow with eyre
anyhow = "1.0.89" # FIXME: replace anyhow with eyre
color-eyre = "0.6.3"
eyre = "0.6.12" # NOTE: keep in sync with verison used by color-eyre
eyre = "0.6.12" # NOTE: keep in sync with verison used by color-eyre
thiserror = "1.0.64"
indoc = "2.0.5"
unindent = "0.2.3"
itertools = "0.13.0"
lazy_static = "1.5.0" # FIXME: replace with Lazy Cell
lazy_static = "1.5.0" # FIXME: replace with Lazy Cell
crossbeam-channel = "0.5.13"
enum_dispatch = "0.3.13"
tap = "1.0.1"
derive_more = { version = "1", features = ["from"] }
cached = "0.53.1" # FIXME: replace usage with a Lazy Cell + dashmap
cached = "0.53.1" # FIXME: replace usage with a Lazy Cell + dashmap
garde = "0.20"
paste = "1.0.15"

Expand Down Expand Up @@ -115,7 +115,7 @@ indexmap = { version = "2.6.0", features = ["serde"] }
semver = "1.0.23"
dashmap = "6.1.0"
connection-string = "0.2.0"
chrono = { version = "0.4.38", features = ["serde"] }
chrono = { version = "0.4.38", features = ["serde"] }
tera = { version = "1.20", default-features = false }
ordered-float = "4.3.0"
graphql-parser = "0.4.0"
Expand Down Expand Up @@ -149,7 +149,7 @@ tracing-unwrap = { version = "1.0.1", features = ["log-location"] }
tracing-appender = "0.2.3"

# async
futures = "=0.3.30" # pinned due to bug with .31 with zeromq (deno)
futures = "=0.3.30" # pinned due to bug with .31 with zeromq (deno)
futures-concurrency = "7.6"
futures-lite = "2.3"
tokio = { version = "1", features = ["parking_lot"] }
Expand All @@ -163,7 +163,9 @@ temporal-sdk-core-protos = { git = "https://github.com/temporalio/sdk-core", rev
# prisma
query-core = { git = "https://github.com/metatypedev/prisma-engines", branch = "fix/version-compat" }
query-connector = { git = "https://github.com/metatypedev/prisma-engines", branch = "fix/version-compat" }
request-handlers = { git = "https://github.com/metatypedev/prisma-engines", features = ["all"], branch = "fix/version-compat" }
request-handlers = { git = "https://github.com/metatypedev/prisma-engines", features = [
"all",
], branch = "fix/version-compat" }
datamodel-renderer = { git = "https://github.com/metatypedev/prisma-engines", branch = "fix/version-compat" }
user-facing-errors = { git = "https://github.com/metatypedev/prisma-engines", branch = "fix/version-compat" }
query-engine-metrics = { git = "https://github.com/metatypedev/prisma-engines", branch = "fix/version-compat" }
Expand All @@ -189,6 +191,9 @@ protobuf = "3.6.0"
protobuf-json-mapping = "3.6.0"
proto-parser = { git = "https://github.com/metatypedev/proto-parser", branch = "main" }

# python
pyo3 = { version = "0.22.5" }

# test
assert_cmd = "2.0.16"
pretty_assertions = "1.4.1"
Expand Down
13 changes: 9 additions & 4 deletions src/typegate/engine/00_runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,21 @@ const Meta = {
metadataAppend: getOp("op_sub_metadata_append"),
metadataWriteWorkflowLink: getOp("op_sub_metadata_write_workflow_link"),
metadataReadWorkflowLinks: getOp("op_sub_metadata_read_workflow_links"),
metadataWriteParentChildLink: getOp("op_sub_metadata_write_parent_child_link"),
metadataEnumerateAllChildren: getOp("op_sub_metadata_enumerate_all_children"),
metadataWriteParentChildLink: getOp(
"op_sub_metadata_write_parent_child_link",
),
metadataEnumerateAllChildren: getOp(
"op_sub_metadata_enumerate_all_children",
),
},
grpc: {
register: getOp("op_grpc_register"),
unregister: getOp("op_grpc_unregister"),
callGrpcMethod: getOp("op_call_grpc_method"),
},
python: {
executePython: getOp("op_execute_python_with_context"),
},
};



globalThis.Meta = Meta;
4 changes: 4 additions & 0 deletions src/typegate/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tracing.workspace = true

# encoding
serde.workspace = true
serde_json.workspace = true
regex.workspace = true
zstd.workspace = true
base64.workspace = true
Expand Down Expand Up @@ -68,6 +69,9 @@ bytes.workspace = true
protobuf.workspace = true
protobuf-json-mapping.workspace = true

# python
pyo3 = { workspace = true, features = ["extension-module"] }
Copy link
Contributor

@michael-0acf4 michael-0acf4 Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extension-module

nice!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, which python version are you experimenting on this?
Is there a way to lock the Python version directly here?


[dev-dependencies]
env_logger.workspace = true

Expand Down
Loading
Loading