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 code validation #939

Merged
merged 6 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ repos:
args:
- --maxkb=768
- id: check-ast
exclude: tests/runtimes/python/py_fail/.*\.py
- id: check-json
exclude: .vscode/.*\.json
- id: check-toml
Expand Down Expand Up @@ -137,8 +138,12 @@ repos:
rev: "v0.5.1"
hooks:
- id: ruff
exclude: tests/runtimes/python/py_fail/.*\.py
- id: ruff-format
exclude: "tests/metagen/typegraphs/sample/py/client.py"
exclude: (?x)(
tests/metagen/typegraphs/sample/py/client.py"|
tests/runtimes/python/py_fail/.*\.py
)
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
hooks:
Expand Down
185 changes: 184 additions & 1 deletion Cargo.lock

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

19 changes: 11 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ members = [
"src/metagen-client-rs",
"tests/metagen/typegraphs/sample/rs",
"tests/metagen/typegraphs/sample/rs_upload",
]
]

exclude = [
"tests/runtimes/wasm_reflected/rust",
Expand Down Expand Up @@ -72,19 +72,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 @@ -119,11 +119,12 @@ 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"
uuid = "1.10.0"
rustpython-parser = "0.4.0"

# wasm
wasmtime = "25.0.2"
Expand Down Expand Up @@ -153,7 +154,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 @@ -167,7 +168,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 Down
3 changes: 3 additions & 0 deletions src/typegate/engine/00_runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ const Meta = {
unregister: getOp("op_grpc_unregister"),
callGrpcMethod: getOp("op_call_grpc_method"),
},
py_validation: {
validate: getOp("op_validate"),
},
};

globalThis.Meta = Meta;
1 change: 1 addition & 0 deletions src/typegate/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ tonic.workspace = true
bytes.workspace = true
protobuf.workspace = true
protobuf-json-mapping.workspace = true
rustpython-parser.workspace = true

[dev-dependencies]
env_logger.workspace = true
Expand Down
Loading
Loading