-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7416c84
commit 0ea28c1
Showing
50 changed files
with
730 additions
and
365 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
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
37 changes: 37 additions & 0 deletions
37
packages/biopython/patches/0001-Remove-error-message-if-wheel-is-not-installed.patch
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,37 @@ | ||
From 434770dc707c5192159249d098e6dbc660fa6556 Mon Sep 17 00:00:00 2001 | ||
From: Hood Chatham <[email protected]> | ||
Date: Thu, 20 Jun 2024 12:31:15 -0700 | ||
Subject: [PATCH] Remove error message if wheel is not installed | ||
|
||
Since pypa/setuptools#4369 was merged, wheel is vendored into setuptools and no | ||
longer needs to be installed for `bdist_wheel` to work. | ||
|
||
Upstream PR: | ||
https://github.com/biopython/biopython/pull/4749 | ||
--- | ||
setup.py | 9 --------- | ||
1 file changed, 9 deletions(-) | ||
|
||
diff --git a/setup.py b/setup.py | ||
index 530b413a9..6cfc48de5 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -37,15 +37,6 @@ except ImportError: | ||
"Try running: python -m ensurepip" | ||
) | ||
|
||
-if "bdist_wheel" in sys.argv: | ||
- try: | ||
- import wheel # noqa: F401 | ||
- except ImportError: | ||
- sys.exit( | ||
- "We need both setuptools AND wheel packages installed " | ||
- "for bdist_wheel to work. Try running: pip install wheel" | ||
- ) | ||
- | ||
|
||
# Make sure we have the right Python version. | ||
MIN_PY_VER = (3, 9) | ||
-- | ||
2.34.1 | ||
|
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,11 @@ | ||
package: | ||
name: cpp-exceptions-test2 | ||
version: "1.0" | ||
tag: | ||
- core | ||
- pyodide.test | ||
source: | ||
path: src | ||
build: | ||
cxxflags: -fexceptions | ||
ldflags: -fexceptions |
13 changes: 13 additions & 0 deletions
13
packages/cpp-exceptions-test2/src/cpp_exceptions_test2.cpp
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,13 @@ | ||
#include "Python.h" | ||
#include <stdexcept> | ||
|
||
extern "C" __attribute__((visibility("default"))) PyObject* | ||
PyInit_cpp_exceptions_test2() | ||
{ | ||
try { | ||
throw std::runtime_error("something bad?"); | ||
} catch (const std::exception& e) { | ||
PyErr_SetString(PyExc_ImportError, "oops"); | ||
} | ||
return nullptr; | ||
} |
Empty file.
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,16 @@ | ||
from setuptools import Extension, setup | ||
|
||
setup( | ||
name="cpp-exceptions-test2", | ||
version="1.0", | ||
ext_modules=[ | ||
Extension( | ||
name="cpp_exceptions_test2", # as it would be imported | ||
# may include packages/namespaces separated by `.` | ||
language="c++", | ||
sources=[ | ||
"cpp_exceptions_test2.cpp" | ||
], # all sources are compiled into a single binary file | ||
), | ||
], | ||
) |
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,16 @@ | ||
package: | ||
name: crc32c | ||
version: "2.4" | ||
top-level: | ||
- crc32c | ||
source: | ||
url: https://files.pythonhosted.org/packages/6f/19/47ac8d1d5b81a83272fe56d4cf425274437fd619ed0af9a5f9805484748c/crc32c-2.4.tar.gz | ||
sha256: d985c4d9b1a1fd16c593d83f8735a8e4e156790a95338a1e0b199aac51ca1e5e | ||
about: | ||
home: https://github.com/ICRAR/crc32c | ||
PyPI: https://pypi.org/project/crc32c | ||
summary: A python package implementing the crc32c algorithm in hardware and software | ||
license: LGPL-2.1-or-later | ||
extra: | ||
recipe-maintainers: | ||
- agriyakhetarpal |
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,60 @@ | ||
# Test suite for the crc32c Pyodide package, based on the original test suite: | ||
# https://github.com/ICRAR/crc32c/blob/master/test/test_crc32c.py | ||
|
||
import pytest | ||
from pytest_pyodide import run_in_pyodide | ||
|
||
|
||
@run_in_pyodide(packages=["crc32c"]) | ||
def test_zero(selenium): | ||
import crc32c | ||
|
||
assert crc32c.crc32c(b"") == 0 | ||
|
||
|
||
TEST_DATA = [ | ||
("Numbers1", b"123456789", 0xE3069283), | ||
("Numbers2", b"23456789", 0xBFE92A83), | ||
("Numbers3", b"1234567890", 0xF3DBD4FE), | ||
("Phrase", b"The quick brown fox jumps over the lazy dog", 0x22620404), | ||
( | ||
"LongPhrase", | ||
( | ||
b"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc omni virtuti vitium contrario nomine opponitur. " | ||
b"Conferam tecum, quam cuique verso rem subicias; Te ipsum, dignissimum maioribus tuis, voluptasne induxit, ut adolescentulus eriperes " | ||
b"P. Conclusum est enim contra Cyrenaicos satis acute, nihil ad Epicurum. Duo Reges: constructio interrete. Tum Torquatus: Prorsus, inquit, assentior;\n" | ||
b"Quando enim Socrates, qui parens philosophiae iure dici potest, quicquam tale fecit? Sed quid sentiat, non videtis. Haec quo modo conveniant, non " | ||
b"sane intellego. Sed ille, ut dixi, vitiose. Dic in quovis conventu te omnia facere, ne doleas. Quod si ita se habeat, non possit beatam praestare " | ||
b"vitam sapientia. Quis suae urbis conservatorem Codrum, quis Erechthei filias non maxime laudat? Primum divisit ineleganter; Huic mori optimum esse " | ||
b"propter desperationem sapientiae, illi propter spem vivere." | ||
), | ||
0xFCB7575A, | ||
), | ||
] | ||
|
||
|
||
@run_in_pyodide(packages=["crc32c"]) | ||
@pytest.mark.parametrize("name, val, checksum", TEST_DATA) | ||
def test_all(selenium, name, val, checksum): | ||
import crc32c | ||
|
||
assert crc32c.crc32c(val) == checksum | ||
|
||
|
||
@run_in_pyodide(packages=["crc32c"]) | ||
@pytest.mark.parametrize("name, val, checksum", TEST_DATA) | ||
def test_piece_by_piece(selenium, name, val, checksum): | ||
# The initial CRC value | ||
c = 0 | ||
|
||
# A generator that yields each byte of the input value | ||
# as a separate byte | ||
def as_individual_bytes(val): | ||
for byte in val: | ||
yield bytes([byte]) | ||
|
||
for x in as_individual_bytes(val): | ||
import crc32c | ||
|
||
c = crc32c.crc32c(x, c) | ||
assert c == checksum |
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
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,16 @@ | ||
package: | ||
name: lakers-python | ||
version: 0.3.0 | ||
top-level: | ||
- lakers | ||
source: | ||
url: https://files.pythonhosted.org/packages/29/93/5d70b035f987a48dd854c1afc21025fb8446aae4d43c685b68691175623c/lakers_python-0.3.0.tar.gz | ||
sha256: 009fc5e31b5a9a276216ff43ffd097004396a2a9131359a1da35d464e599cd1c | ||
requirements: | ||
executable: | ||
- rustup | ||
about: | ||
home: https://github.com/openwsn-berkeley/lakers/ | ||
PyPI: https://pypi.org/project/lakers-python/ | ||
summary: An implementation of EDHOC (RFC 9528) | ||
license: BSD-3-Clause |
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,25 @@ | ||
from pytest_pyodide import run_in_pyodide | ||
|
||
|
||
@run_in_pyodide(packages=["lakers-python"]) | ||
def test_lakers_python(selenium_standalone): | ||
import lakers | ||
|
||
# Running an exchange needs some keys and credentials; those are from the EDHOC test vectors. | ||
R = bytes.fromhex( | ||
"72cc4761dbd4c78f758931aa589d348d1ef874a7e303ede2f140dcf3e6aa4aac" | ||
) | ||
CRED_R = bytes.fromhex( | ||
"A2026008A101A5010202410A2001215820BBC34960526EA4D32E940CAD2A234148DDC21791A12AFBCBAC93622046DD44F02258204519E257236B2A0CE2023F0931F1F386CA7AFDA64FCDE0108C224C51EABF6072" | ||
) | ||
|
||
initiator = lakers.EdhocInitiator() | ||
responder = lakers.EdhocResponder(R, CRED_R) | ||
|
||
message_1 = initiator.prepare_message_1() | ||
responder.process_message_1(message_1) | ||
_message_2 = responder.prepare_message_2( | ||
lakers.CredentialTransfer.ByReference, None, None | ||
) | ||
|
||
# There's a lot more that can be tested, but if this runs through, we've covered the most critical kinds of operations. |
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
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
Oops, something went wrong.