Skip to content

Commit 19be1a1

Browse files
committed
release 0.0.7
1 parent 2f0bace commit 19be1a1

File tree

6 files changed

+44
-31
lines changed

6 files changed

+44
-31
lines changed

.github/workflows/ci-pre-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
- run: uv build
2828

2929
- name: Smoke test (wheel)
30-
run: uv run --isolated --no-project -p 3.12 --with dist/*.whl pytest
30+
run: uv run --isolated --no-project -p 3.12 --with dist/*.whl pytest tests/test_basic_functions.py
3131

3232
- name: Smoke test (source distribution)
33-
run: uv run --isolated --no-project -p 3.12 --with dist/*.tar.gz pytest
33+
run: uv run --isolated --no-project -p 3.12 --with dist/*.tar.gz pytest tests/test_basic_functions.py
3434

3535
- name: publish package
3636
run: uv publish --publish-url https://test.pypi.org/legacy/ --trusted-publishing always

.github/workflows/ci-publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- run: uv build
2929

3030
- name: Smoke test (wheel)
31-
run: uv run --isolated --no-project -p 3.12 --with dist/*.whl
31+
run: uv run --isolated --no-project -p 3.12 --with dist/*.whl pytest tests/test_basic_functions.py
3232

3333
- name: Smoke test (source distribution)
34-
run: uv run --isolated --no-project -p 3.12 --with dist/*.tar.gz
34+
run: uv run --isolated --no-project -p 3.12 --with dist/*.tar.gz pytest tests/test_basic_functions.py
3535

3636
- name: publish package
3737
run: uv publish --trusted-publishing always

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.0.7] - 2025-07-18
11+
12+
### Details
13+
14+
Updated release workflow
15+
1016
## [0.0.5] - 2023-03-28
1117

1218
### Added

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "trrex"
7-
version = "0.0.6"
7+
version = "0.0.7"
88
description = "Transform set of words to efficient regular expression"
99
authors = [
1010
{name = "Daniel Mesejo", email = "mesejoleon@gmail.com"},

tests/test_basic_functions.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import re
2-
from string import ascii_letters, punctuation
3-
4-
from hypothesis import example, given
5-
from hypothesis.strategies import lists, text
62

73
from trrex import make
84

@@ -66,25 +62,3 @@ def test_findall_emoticon():
6662
emoticons = [":)", ":D", ":("]
6763
pattern = compile(emoticons, left=r"(?<!\w)", right=r"(?!\w)")
6864
assert pattern.findall("The smile :), and the laugh :D and the sad :(") == emoticons
69-
70-
71-
@given(text(alphabet=ascii_letters, min_size=1))
72-
def test_single_string_match(s):
73-
pattern = compile([s])
74-
assert pattern.match(s) is not None
75-
76-
77-
@example(lst=["B", "BA", "B"])
78-
@given(lists(text(alphabet=ascii_letters, min_size=1)))
79-
def test_multiple_string_match(lst):
80-
pattern = compile(lst)
81-
for word in lst:
82-
assert pattern.match(word) is not None
83-
84-
85-
@given(lists(text(alphabet=ascii_letters + punctuation, min_size=1)))
86-
def test_multiple_string_match_punctuation(lst):
87-
words = [tuple(map(re.escape, word)) for word in lst]
88-
pattern = compile(words, left="", right="")
89-
for word in lst:
90-
assert pattern.match(word) is not None
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import re
2+
from string import ascii_letters, punctuation
3+
4+
from hypothesis import example, given
5+
from hypothesis.strategies import lists, text
6+
7+
from trrex import make
8+
9+
10+
def compile(lst, flags=0, left=r"\b", right=r"\b"):
11+
return re.compile(make(lst, left, right), flags)
12+
13+
14+
@given(text(alphabet=ascii_letters, min_size=1))
15+
def test_single_string_match(s):
16+
pattern = compile([s])
17+
assert pattern.match(s) is not None
18+
19+
20+
@example(lst=["B", "BA", "B"])
21+
@given(lists(text(alphabet=ascii_letters, min_size=1)))
22+
def test_multiple_string_match(lst):
23+
pattern = compile(lst)
24+
for word in lst:
25+
assert pattern.match(word) is not None
26+
27+
28+
@given(lists(text(alphabet=ascii_letters + punctuation, min_size=1)))
29+
def test_multiple_string_match_punctuation(lst):
30+
words = [tuple(map(re.escape, word)) for word in lst]
31+
pattern = compile(words, left="", right="")
32+
for word in lst:
33+
assert pattern.match(word) is not None

0 commit comments

Comments
 (0)