File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Python Package
2+ on :
3+ release :
4+ types : [ created ]
5+
6+ jobs :
7+ pypi-publish :
8+ name : Upload release to PyPI
9+ runs-on : ubuntu-latest
10+ environment :
11+ name : pypi
12+ url : https://pypi.org/p/signwriting
13+ permissions :
14+ id-token : write
15+ steps :
16+ - uses : actions/checkout@v5
17+
18+ - uses : actions/setup-python@v6
19+ with :
20+ python-version : " 3.12"
21+
22+ - name : Extract release version
23+ id : get_version
24+ run : echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
25+
26+ - name : Update version in pyproject.toml
27+ run : |
28+ sed -i 's/^version = .*/version = "${{ env.version }}"/' pyproject.toml
29+
30+ - name : Install build dependencies
31+ run : pip install build
32+
33+ - name : Build a binary wheel dist
34+ run : |
35+ rm -rf dist
36+ python -m build
37+
38+ - name : Publish distribution 📦 to PyPI
39+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 11import re
22
3+ import regex
4+
35re_swu = {
46 'symbol' : r'[\U00040001-\U0004FFFF]' ,
57 'coord' : r'[\U0001D80C-\U0001DFFF]{2}' ,
@@ -28,3 +30,6 @@ def swu_add_prefix(swu_text: str) -> str:
2830def is_swu (text : str ) -> bool :
2931 # Using the regex pattern instead of the compiled regex for performance (about 30% faster)
3032 return bool (re .fullmatch (re_swu ['sign_with_whitespace' ], text ))
33+
34+ def is_sgnw (text : str ) -> bool :
35+ return bool (regex .fullmatch ("\p{Sutton_SignWriting}+" , text ))
You can’t perform that action at this time.
0 commit comments