Skip to content

Commit

Permalink
Move python code into python/ dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kpp committed Dec 23, 2023
1 parent 8645c77 commit 46787de
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
python -m venv .env
source .env/bin/activate
maturin develop --release --features openssl/vendored
python test.py
python python/test.py
2 changes: 2 additions & 0 deletions sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.env/
target/
__pycache__/
python/aleo/_aleolib.abi3.so
1 change: 1 addition & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
license = "GPL-3.0-or-later"

[lib]
name = "_aleolib"
crate-type = ["cdylib"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion sdk/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ python3 -m venv .env
source .env/bin/activate
pip install maturin
maturin develop
python test.py
python python/test.py
26 changes: 20 additions & 6 deletions sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
[project]
name = "aleo"
description = "A Python SDK for zero-knowledge cryptography based on Aleo"
version = "0.2.0"
readme = "Readme.md"
license = {file = "LICENSE.md"}
authors = [
{name = "Konstantin Pandl"},
{name = "Mike Turner"},
{name = "Roman Proskuryakov"},
]
classifiers = [ # Optional
"Programming Language :: Python :: 3",
]

[project.urls]
"Homepage" = "https://github.com/AleoHQ/python-sdk"

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[tool.maturin]
name = "aleo"
version = "0.2.0"
description = "A Python SDK for zero-knowledge cryptography based on Aleo"
repository = "https://github.com/AleoHQ/python-sdk/tree/master/sdk"
license = "GPL-3.0-or-later"
authors = ["Konstantin Pandl", "Mike Turner", "Roman Proskuryakov"]
python-source = "python"
module-name = "aleo._aleolib"

[tool.pyright]
reportMissingModuleSource = false # don't report missing aleo.so for CI purposes
Expand Down
6 changes: 6 additions & 0 deletions sdk/python/aleo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from __future__ import annotations

from ._aleolib import *

__doc__ = _aleolib.__doc__

File renamed without changes.
Empty file added sdk/python/aleo/py.typed
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use programs::*;
/// Python developers with zk (zero-knowledge) programming capabilities
/// via the usage of Aleo's zkSnarks.
#[pymodule]
#[pyo3(name = "aleo")]
#[pyo3(name = "_aleolib")]
fn register_module(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_class::<Account>()?;
m.add_class::<Address>()?;
Expand Down

0 comments on commit 46787de

Please sign in to comment.