Skip to content

Commit 7740f75

Browse files
authored
[BLY-64] Python Spiral v1, and docs
Python client: use spiral v1, add basic docs Unify client versions at 0.2.0 Add min rustc version to all crates
1 parent 8a4854b commit 7740f75

File tree

23 files changed

+259
-293
lines changed

23 files changed

+259
-293
lines changed

.github/workflows/build-js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
client-publish:
6868
name: Publish JavaScript SDK
6969
runs-on: ubuntu-latest
70-
if: ${{ inputs.publish }}
70+
if: ${{ inputs.publish || github.ref == 'refs/heads/main' }}
7171
needs: [client-build]
7272
steps:
7373
- uses: actions/checkout@v3

.github/workflows/build-python.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Build Python SDK
22

33
env:
4-
BLYSS_STAGING_SERVER: https://dev2.api.blyss.dev
5-
BLYSS_STAGING_API_KEY: Gh1pz1kEiNa1npEdDaRRvM1LsVypM1u2x1YbGb54
4+
BLYSS_STAGING_SERVER: ${{ vars.BLYSS_STAGING_SERVER }}
5+
BLYSS_STAGING_API_KEY: ${{ secrets.BLYSS_STAGING_API_KEY }}
66

77
on:
88
push:
@@ -58,6 +58,24 @@ jobs:
5858
name: wheels
5959
path: python/dist
6060

61+
# only run docs on target x86_64
62+
- name: Build Python docs
63+
if: matrix.target == 'x86_64'
64+
working-directory: python
65+
shell: bash
66+
# TODO: pdoc is documenting the installed module, not the source folder.
67+
# pdoc's import-based docs don't play well with maturin's structure.
68+
run: |
69+
pip install pdoc
70+
pdoc -o pdoc -d google -n blyss --no-search
71+
72+
- name: Upload Python docs
73+
if: matrix.target == 'x86_64'
74+
uses: actions/upload-pages-artifact@v2
75+
with:
76+
path: python/pdoc
77+
78+
6179
windows:
6280
runs-on: windows-latest
6381
needs: [linux]
@@ -126,7 +144,7 @@ jobs:
126144
publish:
127145
name: Publish
128146
runs-on: ubuntu-latest
129-
if: ${{ inputs.publish }}
147+
if: ${{ inputs.publish || github.ref == 'refs/heads/main' }}
130148
needs: [linux, macos, windows, sdist]
131149
steps:
132150
- uses: actions/download-artifact@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ node_modules
88
*.pyc
99
*build/
1010
.DS_Store
11+
.env

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,19 @@ You can also use the Blyss SDK completely locally.
5656
2. Run the server by entering `lib/server` and running `cargo run --release`. The server will run on `localhost:8008` by default.
5757
3. Run the client by entering `examples/node-local` and running `npx ts-node main.ts`. This will perform some writes and then a private read to your bucket.
5858

59-
## Installing as a package
59+
## Install
6060

61+
### JavaScript / Node
6162
To use the Blyss SDK in an existing TypeScript project, install it with `npm install @blyss/sdk`. Then, import the client with `import { Client } from '@blyss/sdk';`. If you're using SDK in Node, and prefer not to use ESM, you can instead import it as `const blyss = require('@blyss/sdk/node')`.
6263

64+
### Python
65+
#### From PyPI:
66+
`pip install --upgrade blyss`
67+
68+
#### From repo:
69+
1. `cd python` from repo root.
70+
2. `pip install --upgrade .`
71+
6372
## Examples
6473

6574
The `examples/` directory has several examples of how to use the Blyss SDK. Running the examples requires [an API key](https://blyss.dev).
@@ -90,8 +99,8 @@ The Node.js example shows how to use the Blyss SDK in server-side JS. Node 18+ i
9099

91100
### Python
92101

93-
1. Enter `examples/python`.
94-
2. Run `pip install blyss`.
102+
1. Install blyss.
103+
2. Enter `examples/python`.
95104
3. Run `python main.py`.
96105

97106
## Documentation

js/bridge/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[package]
22
name = "spiral-rs-js-bridge"
33
description = "Bridge crate between the spiral-rs-client library and the JS client"
4-
version = "0.1.0"
4+
version = "0.2.0"
55
authors = ["Samir Menon <[email protected]>"]
66
license = "MIT"
77
repository = "https://github.com/blyssprivacy/sdk"
88
categories = ["wasm"]
99
readme = "README.md"
1010
edition = "2018"
11+
rust-version = "1.70.0"
1112

1213
[lib]
1314
crate-type = ["cdylib", "rlib"]

js/bucket/bucket_service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export interface BucketParameters {
99
version: number;
1010
}
1111

12-
type MaxItemSizeIdentifier = '100B' | '1KB' | '10KB';
12+
type MaxItemSizeIdentifier = '100' | '1000' | '10000';
1313
type kspIdentifier = 'none' | 'bloom' | 'full';
1414

1515
const DEFAULT_BUCKET_PARAMETERS: BucketParameters = {
16-
maxItemSize: '1KB',
16+
maxItemSize: '1000',
1717
keyStoragePolicy: 'bloom',
1818
version: 1
1919
};

lib/blyss-rs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ keywords = ["privacy", "fhe", "cryptography"]
1212
categories = ["cryptography"]
1313
readme = "README.md"
1414
license = "MIT"
15+
rust-version = "1.70.0"
1516

1617
[dependencies]
1718
base64 = "0.21.0"

lib/doublepir/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "doublepir-rs"
33
version = "0.1.0"
44
edition = "2021"
5+
rust-version = "1.70.0"
56

67
[features]
78
client = ["reqwest", "base64", "sha1"]

lib/server/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ keywords = ["privacy", "fhe", "cryptography"]
1212
categories = ["cryptography"]
1313
readme = "README.md"
1414
license = "MIT"
15+
rust-version = "1.70.0"
1516

1617
[[bin]]
1718
name = "server"

lib/spiral-rs/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)