-
Notifications
You must be signed in to change notification settings - Fork 17
chore: remove dependency on protoletariat and update protobuf #138
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,4 +31,4 @@ jobs: | |
| uvx [email protected] check | ||
| - name: Run ruff formatter | ||
| run: | | ||
| uvx [email protected] format | ||
| uvx [email protected] format --check | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| version: v2 | ||
| plugins: | ||
| - protoc_builtin: python | ||
| out: src/substrait/gen | ||
| - remote: buf.build/community/nipunn1313-mypy:v3.6.0 | ||
| out: src/substrait/gen | ||
| - remote: buf.build/protocolbuffers/python:v33.2 | ||
| out: src | ||
| - remote: buf.build/community/nipunn1313-mypy:v4.0.0 | ||
| out: src |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,23 +2,23 @@ | |
|
|
||
| set -eou pipefail | ||
|
|
||
| namespace=proto | ||
| namespace=substrait.gen.proto | ||
| submodule_dir=./third_party/substrait | ||
| src_dir="$submodule_dir"/proto | ||
| tmp_dir=./buf_work_dir | ||
| dest_dir=./src/substrait/gen | ||
| dest_dir=./src | ||
| extension_dir=./src/substrait/extensions | ||
|
|
||
| # Prefix the protobuf files with a unique configuration to prevent namespace conflicts | ||
| # with other substrait packages. Save output to the work dir. | ||
| python "$submodule_dir"/tools/proto_prefix.py "$tmp_dir" "$namespace" "$src_dir" | ||
|
|
||
| # Remove the old python protobuf files | ||
| rm -rf "$dest_dir/proto" | ||
| rm -rf "$dest_dir/substrait/gen/proto" | ||
|
|
||
| # Generate the new python protobuf files | ||
| buf generate | ||
| uv run protol --in-place --create-package --python-out "$dest_dir" buf | ||
| find "$dest_dir/substrait/gen" -type d -exec touch {}/__init__.py \; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? Can we add a comment explaining why?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the answer is that protoc doesn't automatically generated
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct, protoc / buf don't generate those automatically and the previous ones get rm'ed |
||
|
|
||
| # Remove the old extension files | ||
| rm -rf "$extension_dir" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ authors = [{name = "Substrait contributors", email = "[email protected] | |
| license = {text = "Apache-2.0"} | ||
| readme = "README.md" | ||
| requires-python = ">=3.10,<3.14" | ||
| dependencies = ["protobuf >=3.19.1,<6"] | ||
| dependencies = ["protobuf >=6.33,<7"] | ||
| dynamic = ["version"] | ||
|
|
||
| [tool.setuptools_scm] | ||
|
|
@@ -17,7 +17,7 @@ sql = ["sqloxide", "deepdiff"] | |
|
|
||
| [dependency-groups] | ||
| dev = ["pytest >= 7.0.0", "antlr4-python3-runtime", "pyyaml", "sqloxide", "deepdiff", "duckdb<=1.2.2", "datafusion"] | ||
| gen_proto = ["protobuf >=3.19.1,<6", "protoletariat >= 3.0.0"] | ||
| gen_proto = ["protobuf >=6.33,<7"] | ||
| gen_extensions = ["datamodel-code-generator"] | ||
|
|
||
| [tool.pytest.ini_options] | ||
|
|
||
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Was altering the value of
namespaceanddest_dirnecessary? If so, why?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.
it's necessary since protoc generates the Python imports following the directory structure. with the changed
namespaceit generates a directory structure with the namespace within./buf_work_dir(./buf_work__dir/substrait/gen/proto) which then gets copied over into./src.