-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add nada-mir-proto package and initial uv support (#44)
- Loading branch information
1 parent
9892065
commit 1564c77
Showing
18 changed files
with
1,792 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
|
||
doc: | ||
python -m pip install '.[docs]' && sphinx-build docs docs/_build | ||
uv run sphinx-build docs docs/_build | ||
|
||
release: | ||
pip install --upgrade build wheel | ||
python -m build --no-isolation | ||
|
||
lint: | ||
pylint nada_dsl/ | ||
uv run pylint nada_dsl/ | ||
|
||
test-dependencies: | ||
pip install .'[test]' | ||
|
||
test: test-dependencies | ||
pytest | ||
pytest | ||
|
||
# Build protocol buffers definitions. | ||
build_proto: | ||
nada_mir/scripts/gen_proto.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# NADA MIR | ||
This package contains the protocol buffers representation of the MIR model, defined in: https://github.com/NillionNetwork/nada-mir-model. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "nada-mir-proto" | ||
version = "0.1.0" | ||
description = "The protocol buffers representation of the Nada MIR." | ||
requires-python = ">=3.10" | ||
license = { text = "MIT" } | ||
readme = "README.md" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
|
||
dependencies = ["grpcio-tools==1.62.3", "betterproto==2.0.0b7"] | ||
|
||
[project.optional-dependencies] | ||
dev = ["betterproto[compiler]==2.0.0b7"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# Script to generate protocol buffer bindings for the Nada MIR. | ||
# This script needs to be run to update the protocol buffer definitions every time there's a change | ||
# in `nada-mir-model`. | ||
set -e | ||
|
||
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}" 2>/dev/null)" && pwd -P)" | ||
|
||
# This is the path where nada-mir-model has been checked out in your workstation | ||
NADA_MIR_MODEL_ROOT=${SCRIPT_PATH}/../../../nada-mir-model | ||
GRPC_ROOT=${NADA_MIR_MODEL_ROOT}/proto | ||
|
||
mir_files=( | ||
"nillion/nada/v1/mir.proto" | ||
"nillion/nada/v1/operations.proto" | ||
"nillion/nada/v1/types.proto" | ||
) | ||
|
||
|
||
OUTPUT_DIR=${SCRIPT_PATH}/../src/nada_mir_proto | ||
|
||
mkdir -p ${OUTPUT_DIR} | ||
|
||
cd ${SCRIPT_PATH}/../src | ||
|
||
for file in "${mir_files[@]}"; do | ||
python -m grpc_tools.protoc -I${GRPC_ROOT} --python_betterproto_out=nada_mir_proto $file | ||
done |
Empty file.
Empty file.
Empty file.
Empty file.
169 changes: 169 additions & 0 deletions
169
nada_mir/src/nada_mir_proto/nillion/nada/mir/v1/__init__.py
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
Oops, something went wrong.