Skip to content

Commit c0d067a

Browse files
committed
fix of auto-publish issue
1 parent 5e21549 commit c0d067a

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: publish to pypi
4646
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
4747
run: |
48-
python3 -m twine upload dist/*
48+
python3 -m twine upload dist/*.tar.gz dist/*.whl
4949
env:
5050
TWINE_USERNAME: __token__
5151
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}

bookbuilderpy/preprocessor_code.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ def load_code(path: str, lines: str, labels: str, args: str) -> str:
6464
if len(labels) > 0:
6565
keep_labels = set()
6666
for label in labels.split(","):
67-
keep_labels.add(
68-
enforce_non_empty_str_without_ws(label.strip()))
67+
ll = enforce_non_empty_str_without_ws(label.strip())
68+
if ll in keep_labels:
69+
raise ValueError(f"duplicate label: '{ll}'")
70+
keep_labels.add(ll)
6971
if len(keep_labels) <= 0:
7072
raise ValueError(f"labels='{labels}'.")
7173

@@ -75,8 +77,10 @@ def load_code(path: str, lines: str, labels: str, args: str) -> str:
7577
raise type_error(args, "args", str)
7678
if len(args) > 0:
7779
for arg in args.split(","):
78-
arg_set.add(
79-
enforce_non_empty_str_without_ws(arg.strip()))
80+
aa = enforce_non_empty_str_without_ws(arg.strip())
81+
if aa in arg_set:
82+
raise ValueError(f"duplicate argument: '{aa}'")
83+
arg_set.add(aa)
8084

8185
text: Final[List[str]] = src.read_all_list()
8286
if len(text) <= 0:

bookbuilderpy/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""An internal file with the version of the bookbuilderpy package."""
22
from typing import Final
33

4-
__version__: Final[str] = "1.9.26"
4+
__version__: Final[str] = "1.9.27"

0 commit comments

Comments
 (0)