Skip to content

Commit d405238

Browse files
authored
build: integrate with substrait-extensions package (#156)
substrait-extensions is a dedicated Python package holding Substrait related extension files alongside generated binding code for them. Usage of this library allows us to remove the substrait submodule in this repository. BREAKING CHANGE: extension files must now be retrieved from substrait-extensions BREAKING CHANGE: substrait.gen.json modules has been removed
1 parent 8c80fe2 commit d405238

42 files changed

Lines changed: 99 additions & 7976 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codegen-check.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/example.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v6
25-
with:
26-
submodules: recursive
2725
- name: Install uv with python
2826
uses: astral-sh/setup-uv@v7
2927
with:

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v6
19-
with:
20-
submodules: recursive
2119
- name: Set up Python
2220
uses: actions/setup-python@v6
2321
with:

.github/workflows/ruff.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v6
22-
with:
23-
submodules: recursive
2422
- uses: prefix-dev/setup-pixi@v0.9.4
2523
with:
2624
pixi-version: v0.62.2

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
steps:
2121
- name: Checkout code
2222
uses: actions/checkout@v6
23-
with:
24-
submodules: recursive
2523
- name: Install uv with python
2624
uses: astral-sh/setup-uv@v7
2725
with:

.github/workflows/version-checks.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jobs:
1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v6
16-
with:
17-
submodules: recursive
1816

1917
- name: Install uv with python
2018
uses: astral-sh/setup-uv@v7

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "third_party/substrait"]
2-
path = third_party/substrait
3-
url = https://github.com/substrait-io/substrait

CONTRIBUTING.md

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Get the repo
33
Fork and clone the repo.
44
```
5-
git clone --recursive https://github.com/<your-fork>/substrait-python.git
5+
git clone https://github.com/<your-fork>/substrait-python.git
66
cd substrait-python
77
```
88

@@ -12,47 +12,6 @@ Activate environment with uv.
1212
uv sync --extra test
1313
```
1414

15-
## Update the substrait submodule locally
16-
You can run update-submodule task to pull in latest substrait from upstream.
17-
```
18-
pixi run update-submodule <version>
19-
```
20-
21-
Or you can update submodule and run code generation at the same time with
22-
```
23-
pixi run update-substrait
24-
```
25-
26-
This might be necessary if you are updating an existing checkout.
27-
```
28-
git submodule sync --recursive
29-
git submodule update --init --recursive
30-
```
31-
32-
# Code generation
33-
34-
You can run the full code generation using the following command or use the individual commands to selectively regenerate the generated code. This does not update the Substrait Git submodule. You can use pixi environment defined in pyproject.toml which contains all dependencies needed for code generation.
35-
36-
```
37-
pixi run codegen
38-
```
39-
40-
## Extension Copying
41-
42-
Copy the core function extensions into substrait-python
43-
44-
```
45-
pixi run copy-extensions
46-
```
47-
48-
## Extensions stubs
49-
50-
Substrait uses jsonschema to describe the data model for extension files.
51-
52-
```
53-
pixi run codegen-extensions
54-
```
55-
5615
# Lint & Format
5716

5817
Run the following pixi tasks to lint and format with ruff.

check_codegen.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

check_substrait_package_versions.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ set -euo pipefail
44
# Check that all substrait-* packages have the same version
55
uv sync
66

7-
protobuf_version=$(uv pip show substrait-protobuf | grep '^Version:' | awk '{print $2}')
87
antlr_version=$(uv pip show substrait-antlr | grep '^Version:' | awk '{print $2}')
8+
extension_version=$(uv pip show substrait-extensions | grep '^Version:' | awk '{print $2}')
9+
protobuf_version=$(uv pip show substrait-protobuf | grep '^Version:' | awk '{print $2}')
910

1011
if [ "$protobuf_version" != "$antlr_version" ]; then
1112
echo "error: substrait-protobuf ($protobuf_version) and substrait-antlr ($antlr_version) versions do not match"
1213
exit 1
1314
fi
15+
16+
if [ "$protobuf_version" != "$extension_version" ]; then
17+
echo "error: substrait-protobuf ($protobuf_version) and substrait-extension ($extension_version) versions do not match"
18+
exit 1
19+
fi

0 commit comments

Comments
 (0)