Skip to content

Commit 9f8d90f

Browse files
committed
Merge remote-tracking branch 'origin/main' into nn-meta-provenance
# Conflicts: # Makefile # go/src/parser.go # julia/LQPParser/src/parser.jl # julia/LQPParser/test/runtests.jl # meta/src/meta/__init__.py # meta/src/meta/codegen_base.py # meta/src/meta/codegen_go.py # meta/src/meta/codegen_julia.py # meta/src/meta/codegen_python.py # meta/src/meta/grammar.py # meta/src/meta/grammar_utils.py # meta/src/meta/grammar_validator.py # meta/src/meta/parser_gen.py # meta/src/meta/pretty_gen.py # meta/src/meta/pretty_gen_python.py # meta/src/meta/target.py # meta/src/meta/target_builtins.py # meta/src/meta/target_print.py # meta/src/meta/target_utils.py # meta/src/meta/templates/parser.go.template # meta/src/meta/templates/parser.jl.template # meta/src/meta/templates/parser.py.template # meta/src/meta/templates/pretty_printer.py.template # meta/src/meta/type_env.py # meta/src/meta/yacc_parser.py # meta/tests/meta/test_analysis.py # meta/tests/meta/test_codegen_go.py # meta/tests/meta/test_codegen_julia.py # meta/tests/meta/test_codegen_python.py # meta/tests/meta/test_grammar.py # meta/tests/meta/test_grammar_utils.py # meta/tests/meta/test_grammar_validator.py # meta/tests/meta/test_parser_gen.py # meta/tests/meta/test_terminal_sequence_set.py # python-tools/src/lqp/cli.py # python-tools/src/lqp/gen/parser.py # python-tools/src/meta/codegen_templates.py # python-tools/src/meta/grammar.y # python-tools/src/meta/yacc_action_parser.py # python-tools/tests/test_generated_parser.py # python-tools/tests/test_proto_validator.py # sdks/go/test/parser_test.go # sdks/julia/LogicalQueryProtocol.jl/src/gen/relationalai/lqp/v1/fragments_pb.jl # sdks/julia/LogicalQueryProtocol.jl/src/gen/relationalai/lqp/v1/logic_pb.jl # sdks/julia/LogicalQueryProtocol.jl/src/gen/relationalai/lqp/v1/transactions_pb.jl # sdks/python/src/lqp/gen/pretty.py # sdks/python/src/lqp/generated_pretty_printer.py # sdks/python/src/lqp/proto_validator.py # sdks/python/tests/test_generated_pretty_printer.py
2 parents 2c98af7 + 0db98b4 commit 9f8d90f

485 files changed

Lines changed: 46821 additions & 35755 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,50 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
python-version: ["3.11"]
12+
python-version: ["3.10", "3.11"]
13+
14+
env:
15+
UV_PYTHON: ${{ matrix.python-version }}
1316

1417
steps:
15-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1619

17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v4
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
1922
with:
2023
python-version: ${{ matrix.python-version }}
2124

22-
- name: Install dependencies
25+
- name: Lint
26+
run: |
27+
cd sdks/python
28+
uv run ruff check
29+
uv run ruff format --check
30+
31+
- name: Lint meta
32+
run: |
33+
cd meta
34+
uv run ruff check
35+
uv run ruff format --check
36+
37+
- name: Test meta with pytest
38+
run: |
39+
cd meta
40+
uv run python -m pytest
41+
42+
- name: Type check meta
2343
run: |
24-
python -m pip install --upgrade pip
25-
cd python-tools
26-
python -m pip install -e ".[test]"
27-
python -m pip install pyrefly
44+
cd meta
45+
uv run pyrefly check
2846
29-
- name: Test with pytest
47+
- name: Run tests
3048
run: |
31-
cd python-tools
32-
python -m pytest
49+
cd sdks/python
50+
uv run python -m pytest
3351
3452
- name: Type check
3553
run: |
36-
cd python-tools
37-
pyrefly check
54+
cd sdks/python
55+
uv run pyrefly check
3856
3957
julia-test:
4058
runs-on: ubuntu-latest
@@ -44,7 +62,7 @@ jobs:
4462
julia-version: ["1.10", "1.11", "1.12"]
4563

4664
steps:
47-
- uses: actions/checkout@v3
65+
- uses: actions/checkout@v4
4866

4967
- name: Set up Julia ${{ matrix.julia-version }}
5068
uses: julia-actions/setup-julia@v2
@@ -53,7 +71,7 @@ jobs:
5371

5472
- name: Run tests
5573
run: |
56-
cd julia/LQPParser
74+
cd sdks/julia/LogicalQueryProtocol.jl
5775
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.test()'
5876
5977
go-test:
@@ -64,14 +82,14 @@ jobs:
6482
go-version: ["1.25"]
6583

6684
steps:
67-
- uses: actions/checkout@v3
85+
- uses: actions/checkout@v4
6886

6987
- name: Set up Go
70-
uses: actions/setup-go@v4
88+
uses: actions/setup-go@v5
7189
with:
7290
go-version: '1.25'
7391

7492
- name: Run tests
7593
run: |
76-
cd go
77-
go test -v ./test/print_test.go
94+
cd sdks/go
95+
go test -v ./test/...
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Python package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v5
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Build package
23+
run: |
24+
cd sdks/python
25+
uv run python -m build
26+
27+
- name: Upload build artifacts
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: dist
31+
path: sdks/python/dist/
32+
33+
publish:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
environment: pypi
37+
permissions:
38+
id-token: write
39+
40+
steps:
41+
- name: Download build artifacts
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: dist
45+
path: dist/
46+
47+
- name: Publish to PyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
.DS_Store
2-
3-
# LispyQP
4-
__pycache__/
5-
python-tools/dist/
6-
python-tools/build/
7-
python-tools/src/*.egg-info/
8-
python-tools/out/
9-
python-tools/.lsp/.cache
1+
# Code generators
2+
meta/build/
3+
meta/src/*.egg-info/
104

115
# Proto generated files
12-
./gen
6+
/gen
137

14-
.envrc
8+
# Python SDK
159
.venv
1610
.pytest_cache
17-
**/uv.lock
18-
julia/LQPParser/Manifest.toml
11+
__pycache__/
12+
sdks/python/dist/
13+
sdks/python/build/
14+
sdks/python/src/*.egg-info/
15+
sdks/python/out/
16+
sdks/python/.lsp/.cache
17+
sdks/python/.clj-kondo
18+
19+
# Go SDK
20+
sdks/go/test/lqp_pretty_output
21+
22+
# Other
23+
.DS_Store
24+
.envrc
25+
.lsp
26+
.clj-kondo

CLAUDE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ class".
55
The protobuf specification is located in the `proto/` sub-directory. Auto-generated code by
66
the protobuf compiler should be in `gen/`.
77

8-
Python tooling is in `python-tools/`. Check the `python-tools/README.md` for more
9-
instructions, e.g. how to verify your changes.
8+
SDKs for each first-class language are in `sdks/`. Check the respective README's for more
9+
instructions. Each SDK contains a parser and pretty-printer for a S-expression
10+
representation of the LQP, which is human-readable and meant for testing and debugging.
1011

11-
For each of the three first class languages, we intend to provide the following tools:
12+
Any changes to the protobuf specification will need to be reflected in all SDKs.
1213

13-
1. A parser for the S-expression based human-readable representation of LQP.
14-
2. A pretty printer, to convert from proto messages to the human-readable representation.
15-
3. An IR.
14+
Any changes to the protobuf specification should be covered by tests in `tests/`.
1615

17-
Any changes to the protobuf specification will need to be reflected in all three of those.
16+
Building and testing of the ProtoBuf code and SDKs is driven by the top-level `Makefile`.
17+
18+
IMPORTANT: Do not edit generated source files directly. Instead edit either the protobuf
19+
specifications in `proto/` or the meta-tooling in `meta/`.
1820

19-
Once the parser is updated, the test cases in `python-tools/tests/test_files/lqp` may need
20-
to be updated accordingly.

0 commit comments

Comments
 (0)