Skip to content

Commit bf744ed

Browse files
CopilotDerThorstenIsabelParedes
authored
Add lakers-python recipe for emscripten-forge (emscripten-forge#2747)
* Add lakers-python recipe for emscripten-forge Co-authored-by: DerThorsten <[email protected]> * Updated source URL format and changed license information * Add license file --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: DerThorsten <[email protected]> Co-authored-by: Isabel Paredes <[email protected]>
1 parent 41ec05c commit bf744ed

File tree

4 files changed

+95
-0
lines changed

4 files changed

+95
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright (c), Inria.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
- Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
10+
- Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
- Neither the name of Inria nor the names of its contributors may be used
15+
to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28+
POSSIBILITY OF SUCH DAMAGE.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
export MATURIN_PYTHON_SYSCONFIGDATA_DIR=${PREFIX}/etc/conda/_sysconfigdata__emscripten_wasm32-emscripten.py
4+
${PYTHON} -m pip install . -vvv
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
context:
2+
name: lakers-python
3+
version: 0.5.0
4+
5+
package:
6+
name: ${{ name }}
7+
version: ${{ version }}
8+
9+
source:
10+
- url: https://pypi.io/packages/source/${{ name[0] }}/${{ name }}/${{ name|replace('-','_') }}-${{ version }}.tar.gz
11+
sha256: 19059fde5572409f061c3dfcaa12f1634572ff3622b45f81853d05bb67a37bc5
12+
13+
build:
14+
number: 0
15+
16+
requirements:
17+
build:
18+
- cross-python_${{ target_platform }}
19+
- cffi == 1.17.1
20+
- setuptools-rust
21+
- rust
22+
- maturin
23+
host:
24+
- python
25+
- cffi == 1.17.1
26+
run:
27+
- cffi == 1.17.1
28+
29+
tests:
30+
- script: pytester
31+
requirements:
32+
build:
33+
- pytester
34+
run:
35+
- pytester-run
36+
files:
37+
recipe:
38+
- test_import_lakers.py
39+
40+
about:
41+
summary: Python wrapper for the lakers crate (EDHOC implementation in Rust)
42+
license: BSD-3-Clause
43+
license_file: LICENSE.md
44+
homepage: https://crates.io/crates/lakers
45+
repository: https://github.com/lake-rs/lakers
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def test_lakers_import():
2+
"""Test that lakers package can be imported successfully."""
3+
import lakers
4+
5+
# Test basic import and availability of key functions
6+
assert hasattr(lakers, 'EdhocInitiator'), "EdhocInitiator should be available"
7+
assert hasattr(lakers, 'p256_generate_key_pair'), "p256_generate_key_pair should be available"
8+
9+
# Test basic functionality
10+
# Generate a keypair
11+
key_pair = lakers.p256_generate_key_pair()
12+
assert key_pair is not None, "Key pair generation should work"
13+
14+
# Instantiate an initiator
15+
initiator = lakers.EdhocInitiator()
16+
assert initiator is not None, "EdhocInitiator should be instantiable"
17+
18+
print("lakers-python import and basic functionality test passed")

0 commit comments

Comments
 (0)