Skip to content

Commit 7a40f7f

Browse files
authored
Publish fix (#12)
* fix(workflow.publish): Fix pypa action version.
1 parent 94a70f9 commit 7a40f7f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
path: dist/
8383

8484
- name: Publish package
85-
uses: pypa/gh-action-pypi-publish@v.1.13.0
85+
uses: pypa/gh-action-pypi-publish@v1.13.0
8686
with:
8787
user: __token__
8888
password: ${{ secrets.PYPI_API_TOKEN }}

tests/unit/test_oligos.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,21 @@ def inner(s: str, *args) -> Any:
6767
return inner
6868

6969

70+
def wrap_slice(f: Callable[[str], Any]) -> Callable[[str], str]:
71+
"""Wrap a function which uses a string, and returns a substring output."""
72+
73+
@wraps(f)
74+
def inner(s: str, *args) -> str:
75+
b: bytes = s.encode("utf8")
76+
ba: bytearray = bytearray(b)
77+
m: memoryview = memoryview(ba)
78+
a, b = f(m, *args)
79+
80+
return s[a:b]
81+
82+
return inner
83+
84+
7085
@pytest.mark.parametrize(
7186
"function",
7287
[
@@ -202,6 +217,8 @@ def test_reverse_complement(
202217
("AAT", 1),
203218
("ATGC", 0),
204219
("AAAAACCCCCCGGGGGGG", 6),
220+
("A" * 10 + "T", 9),
221+
("T" + "A" * 10, 9),
205222
],
206223
)
207224
def test_stretch(seq, expected: int, function: Callable[[str], int]) -> None:
@@ -250,6 +267,7 @@ def test_nrepeats(
250267
"function",
251268
[
252269
oligos.palindrome,
270+
wrap_slice(_oligos.m_palindrome),
253271
oligos.palindrome_py,
254272
oligos.manacher,
255273
],

0 commit comments

Comments
 (0)