Skip to content

Commit 97d8b7d

Browse files
comnikclaude
andauthored
Move SDKs (#198)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3e1f6a0 commit 97d8b7d

95 files changed

Lines changed: 552 additions & 574 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: Lint
2626
run: |
27-
cd python-tools
27+
cd sdks/python
2828
uv run ruff check
2929
uv run ruff format --check
3030
@@ -46,12 +46,12 @@ jobs:
4646
4747
- name: Run tests
4848
run: |
49-
cd python-tools
49+
cd sdks/python
5050
uv run python -m pytest
5151
5252
- name: Type check
5353
run: |
54-
cd python-tools
54+
cd sdks/python
5555
uv run pyrefly check
5656
5757
julia-test:
@@ -71,7 +71,7 @@ jobs:
7171

7272
- name: Run tests
7373
run: |
74-
cd julia/LogicalQueryProtocol
74+
cd sdks/julia/LogicalQueryProtocol
7575
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.test()'
7676
7777
go-test:
@@ -91,5 +91,5 @@ jobs:
9191

9292
- name: Run tests
9393
run: |
94-
cd go
94+
cd sdks/go
9595
go test -v ./test/print_test.go

.github/workflows/publish-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121

2222
- name: Build package
2323
run: |
24-
cd python-tools
24+
cd sdks/python
2525
uv run python -m build
2626
2727
- name: Upload build artifacts
2828
uses: actions/upload-artifact@v4
2929
with:
3030
name: dist
31-
path: python-tools/dist/
31+
path: sdks/python/dist/
3232

3333
publish:
3434
needs: build

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ meta/src/*.egg-info/
99
.venv
1010
.pytest_cache
1111
__pycache__/
12-
python-tools/dist/
13-
python-tools/build/
14-
python-tools/src/*.egg-info/
15-
python-tools/out/
16-
python-tools/.lsp/.cache
17-
python-tools/.clj-kondo
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
1818

1919
# Julia SDK
20-
julia/LogicalQueryProtocol/Manifest.toml
20+
sdks/julia/LogicalQueryProtocol/Manifest.toml
2121

2222
# Other
2323
.DS_Store

Makefile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ PROTO_FILES := \
2929
GRAMMAR := meta/src/meta/grammar.y
3030

3131
# Generated protobuf outputs
32-
PY_PROTO_DIR := python-tools/src/lqp/proto/v1
33-
JL_PROTO_DIR := julia/LogicalQueryProtocol/src/gen/relationalai/lqp/v1
34-
GO_PROTO_DIR := go/src/lqp/v1
32+
PY_PROTO_DIR := sdks/python/src/lqp/proto/v1
33+
JL_PROTO_DIR := sdks/julia/LogicalQueryProtocol/src/gen/relationalai/lqp/v1
34+
GO_PROTO_DIR := sdks/go/src/lqp/v1
3535

3636
# Generated parser outputs
37-
PY_PARSER := python-tools/src/lqp/gen/parser.py
38-
JL_PARSER := julia/LogicalQueryProtocol/src/parser.jl
39-
GO_PARSER := go/src/parser.go
37+
PY_PARSER := sdks/python/src/lqp/gen/parser.py
38+
JL_PARSER := sdks/julia/LogicalQueryProtocol/src/parser.jl
39+
GO_PARSER := sdks/go/src/parser.go
4040

4141
# Generated printer outputs
42-
PY_PRINTER := python-tools/src/lqp/gen/pretty.py
42+
PY_PRINTER := sdks/python/src/lqp/gen/pretty.py
4343

4444
# Parser templates
4545
PY_TEMPLATE := meta/src/meta/templates/parser.py.template
@@ -79,7 +79,7 @@ JL_PROTO_GENERATED := \
7979

8080
all: protobuf parsers printers
8181

82-
# ---------- protobuf build (replaces ./build script) ----------
82+
# ---------- protobuf build ----------
8383

8484
protobuf: $(PY_PROTO_GENERATED) $(GO_PROTO_GENERATED) $(JL_PROTO_GENERATED)
8585

@@ -106,73 +106,73 @@ $(PY_PROTO_GENERATED) $(GO_PROTO_GENERATED): $(PROTO_FILES)
106106
$(JL_PROTO_GENERATED): $(PROTO_FILES)
107107
buf lint
108108
buf breaking --against ".git#branch=main,subdir=proto"
109-
cd julia && julia --project=LogicalQueryProtocol generate_proto.jl
109+
cd sdks/julia && julia --project=LogicalQueryProtocol generate_proto.jl
110110

111111
# ---------- parser generation ----------
112112

113113
parsers: parser-python parser-julia parser-go
114114

115115
parser-python: $(PY_PARSER)
116116
$(PY_PARSER): $(PROTO_FILES) $(GRAMMAR) $(PY_TEMPLATE)
117-
$(META_CLI) $(META_PROTO_ARGS) --parser python -o ../python-tools/src/lqp/gen/parser.py
117+
$(META_CLI) $(META_PROTO_ARGS) --parser python -o ../sdks/python/src/lqp/gen/parser.py
118118

119119
parser-julia: $(JL_PARSER)
120120
$(JL_PARSER): $(PROTO_FILES) $(GRAMMAR) $(JL_TEMPLATE)
121-
$(META_CLI) $(META_PROTO_ARGS) --parser julia -o ../julia/LogicalQueryProtocol/src/parser.jl
121+
$(META_CLI) $(META_PROTO_ARGS) --parser julia -o ../sdks/julia/LogicalQueryProtocol/src/parser.jl
122122

123123
parser-go: $(GO_PARSER)
124124
$(GO_PARSER): $(PROTO_FILES) $(GRAMMAR) $(GO_TEMPLATE)
125-
$(META_CLI) $(META_PROTO_ARGS) --parser go -o ../go/src/parser.go
125+
$(META_CLI) $(META_PROTO_ARGS) --parser go -o ../sdks/go/src/parser.go
126126

127127
force-parsers: force-parser-python force-parser-julia force-parser-go
128128

129129
force-parser-python:
130-
$(META_CLI) $(META_PROTO_ARGS) --parser python -o ../python-tools/src/lqp/gen/parser.py
130+
$(META_CLI) $(META_PROTO_ARGS) --parser python -o ../sdks/python/src/lqp/gen/parser.py
131131

132132
force-parser-julia:
133-
$(META_CLI) $(META_PROTO_ARGS) --parser julia -o ../julia/LogicalQueryProtocol/src/parser.jl
133+
$(META_CLI) $(META_PROTO_ARGS) --parser julia -o ../sdks/julia/LogicalQueryProtocol/src/parser.jl
134134

135135
force-parser-go:
136-
$(META_CLI) $(META_PROTO_ARGS) --parser go -o ../go/src/parser.go
136+
$(META_CLI) $(META_PROTO_ARGS) --parser go -o ../sdks/go/src/parser.go
137137

138138
# ---------- printer generation ----------
139139

140140
printers: printer-python
141141

142142
printer-python: $(PY_PRINTER)
143143
$(PY_PRINTER): $(PROTO_FILES) $(GRAMMAR) $(PY_PRINTER_TEMPLATE)
144-
$(META_CLI) $(META_PROTO_ARGS) --printer python -o ../python-tools/src/lqp/gen/pretty.py
144+
$(META_CLI) $(META_PROTO_ARGS) --printer python -o ../sdks/python/src/lqp/gen/pretty.py
145145

146146
force-printers: force-printer-python
147147

148148
force-printer-python:
149-
$(META_CLI) $(META_PROTO_ARGS) --printer python -o ../python-tools/src/lqp/gen/pretty.py
149+
$(META_CLI) $(META_PROTO_ARGS) --printer python -o ../sdks/python/src/lqp/gen/pretty.py
150150

151151
# ---------- testing ----------
152152

153153
test: test-meta test-python test-julia test-go
154154

155155
test-python: $(PY_PARSER) $(PY_PROTO_GENERATED) check-python
156-
cd python-tools && uv run python -m pytest
156+
cd sdks/python && uv run python -m pytest
157157

158158
test-python-update-snapshots: $(PY_PARSER) $(PY_PROTO_GENERATED)
159-
cd python-tools && uv run python -m pytest --snapshot-update
159+
cd sdks/python && uv run python -m pytest --snapshot-update
160160

161161
test-julia: $(JL_PARSER) $(JL_PROTO_GENERATED)
162-
cd julia && julia --project=LogicalQueryProtocol -e 'using Pkg; Pkg.test()'
162+
cd sdks/julia && julia --project=LogicalQueryProtocol -e 'using Pkg; Pkg.test()'
163163

164164
test-go: $(GO_PARSER) $(GO_PROTO_GENERATED)
165-
cd go && go test ./test/...
165+
cd sdks/go && go test ./test/...
166166

167167
check-python: lint-python
168-
cd python-tools && uv run pyrefly check
168+
cd sdks/python && uv run pyrefly check
169169

170170
lint-python:
171-
cd python-tools && uv run ruff check
172-
cd python-tools && uv run ruff format --check
171+
cd sdks/python && uv run ruff check
172+
cd sdks/python && uv run ruff format --check
173173

174174
format-python:
175-
cd python-tools && uv run ruff format
175+
cd sdks/python && uv run ruff format
176176

177177
test-meta: check-meta
178178
cd meta && uv run python -m pytest

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,22 @@ lockstep, so compatibility in both directions is key. The vast majority of proto
3131
should be extensions. Existing messages can only be changed or removed when we can guarantee
3232
that they are no longer in use by existing clients in the wild.
3333

34-
In order to validate your changes and check for compatibility issues such as accidental
35-
reuse of field numbers, run
34+
In order to regenerate the ProtoBuf code for each of the three first-class languages, run:
3635

3736
```
38-
make protobuf-lint
37+
make protobuf
3938
```
4039

41-
Please refer to the [buf
40+
This will also validate your changes and check for compatibility issues such as accidental
41+
reuse of field numbers. Please refer to the [buf
4242
documentation](https://buf.build/docs/cli/quickstart/#detect-breaking-changes) to understand
4343
any warnings that this check may produce.
4444

45-
To regenerate the ProtoBuf code for each of the three first-class languages, run
46-
47-
```
48-
make protobuf
49-
```
50-
5145
Check in your changes and then move on to updating the SDKs.
5246

5347
### Adding tests
5448

55-
Protocol extensions should be covered by tests, which are all located in `test/`. Just add
49+
Protocol extensions should be covered by tests, which are all located in `tests/`. Just add
5650
new `.lqp` files that make use of the new construct you are introducing. To run the tests:
5751

5852
```
@@ -80,11 +74,17 @@ The code generators are implemented in `meta/`.
8074

8175
Releasing a new version of the LQP is done by releasing new versions of each of the SDKs.
8276

83-
This package is [deployed to PyPI](https://pypi.org/project/lqp/). For maintainers, these
84-
are the steps to deploy a new version:
77+
The Python SDK is [deployed to PyPI](https://pypi.org/project/lqp/). Publishing is automated
78+
via GitHub Actions: creating a GitHub release triggers a workflow that builds and uploads the
79+
package to PyPI. To release a new version:
80+
81+
1. Update the version in `sdks/python/pyproject.toml`
82+
2. Create a new GitHub release
8583

86-
1. `cd` into python-tools in the LQP repo
87-
2. Make sure the `dist` directory is empty if it exists
88-
3. `python -m build`
89-
4. `python -m twine upload dist/*`
90-
* You will need to enter your API token for PyPi
84+
To publish manually instead:
85+
86+
```bash
87+
cd sdks/python
88+
uv run python -m build
89+
uv run twine upload dist/*
90+
```

build

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

meta/src/meta/templates/parser.go.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Generated from protobuf specifications.
44
// Do not modify this file! If you need to modify the parser, edit the generator code
5-
// in `python-tools/src/meta` or edit the protobuf specification in `proto/v1`.
5+
// in `meta/` or edit the protobuf specification in `proto/v1`.
66
//
77
// {command_line_comment}
88

meta/src/meta/templates/parser.jl.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Auto-generated LL(k) recursive-descent parser.
33

44
Generated from protobuf specifications.
55
Do not modify this file! If you need to modify the parser, edit the generator code
6-
in `python-tools/src/meta` or edit the protobuf specification in `proto/v1`.
6+
in `meta/` or edit the protobuf specification in `proto/v1`.
77

88
{command_line_comment}"""
99

meta/src/meta/templates/parser.py.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Auto-generated LL(k) recursive-descent parser.
33

44
Generated from protobuf specifications.
55
Do not modify this file! If you need to modify the parser, edit the generator code
6-
in `python-tools/src/meta` or edit the protobuf specification in `proto/v1`.
6+
in `meta/` or edit the protobuf specification in `proto/v1`.
77

88
{command_line_comment}"""
99

meta/src/meta/templates/pretty_printer.py.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Auto-generated pretty printer.
33

44
Generated from protobuf specifications.
55
Do not modify this file! If you need to modify the pretty printer, edit the generator code
6-
in `python-tools/src/meta` or edit the protobuf specification in `proto/v1`.
6+
in `meta/` or edit the protobuf specification in `proto/v1`.
77

88
{command_line_comment}"""
99

0 commit comments

Comments
 (0)