Skip to content

Commit dce4c13

Browse files
committed
fix: regenerate antlr and fix devcontainer
Closes #119
1 parent f6201bb commit dce4c13

File tree

6 files changed

+763
-678
lines changed

6 files changed

+763
-678
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
FROM mcr.microsoft.com/vscode/devcontainers/python:3.13
22
USER vscode
3+
ENV HOME=/home/vscode
34
RUN curl -s "https://get.sdkman.io" | bash
45
SHELL ["/bin/bash", "-c"]
56
RUN source "/home/vscode/.sdkman/bin/sdkman-init.sh" && sdk install java 25-graalce
67
RUN mkdir -p ~/lib && cd ~/lib && curl -L -O http://www.antlr.org/download/antlr-4.13.2-complete.jar
7-
ENV ANTLR_JAR="~/lib/antlr-4.13.1-complete.jar"
8+
ENV ANTLR_JAR="${HOME}/lib/antlr-4.13.2-complete.jar"
89
# protoc 29.5 is the last version with protobuf python v5 which is compatible with protoletariat v3
910
RUN cd ~ && curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v29.5/protoc-29.5-linux-x86_64.zip && \
1011
unzip protoc-29.5-linux-x86_64.zip -d ~/.local && \

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "substrait-python-devcontainer",
33
"build": {
44
"context": "..",
5-
"dockerfile": "Dockerfile",
6-
"options": ["--format=docker"]
5+
"dockerfile": "Dockerfile"
76
},
87

98
// Features to add to the dev container. More info: https://containers.dev/features.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ pip install substrait
1717
conda install -c conda-forge python-substrait # or use mamba
1818
```
1919

20+
## Development
21+
22+
### Regenerating the ANTLR Parser
23+
24+
The `make antlr` task regenerates the parser from the Substrait type grammar and requires ANTLR and Java to be installed. If you want to run this task with ANTLR already set up, use the dev container:
25+
26+
```sh
27+
devcontainer up --workspace-folder .
28+
devcontainer exec --workspace-folder . make antlr
29+
```
30+
2031
## Goals
2132
This project aims to provide a Python interface for the Substrait specification. It will allow users to construct and manipulate a Substrait Plan from Python for evaluation by a Substrait consumer, such as DataFusion or DuckDB.
2233

0 commit comments

Comments
 (0)