Skip to content

Commit 49ed280

Browse files
committed
fix: update release workflow to only trigger on published releases and improve optional fields in data classes
1 parent 4aa6add commit 49ed280

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main] # bump version & create Release
66
release:
7-
types: [published, created] # build & upload to PyPI
7+
types: [published] # build & upload to PyPI
88
workflow_dispatch: # allow manual trigger
99

1010
permissions:
@@ -52,7 +52,7 @@ jobs:
5252
git config user.name "github-actions"
5353
git config user.email "github-actions@github.com"
5454
git add src/veedb/VERSION
55-
git commit -m "chore: bump version to v$NEW_VERSION [skip ci]" || true
55+
git commit -m "chore: bump version to v$NEW_VERSION" || true
5656
git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION"
5757
git push origin HEAD
5858
git push origin "v$NEW_VERSION"
@@ -103,7 +103,8 @@ jobs:
103103

104104
- name: Set up Python
105105
uses: actions/setup-python@v5.6.0
106-
with: { python-version: '3.x' }
106+
with:
107+
python-version: '3.x'
107108

108109
- name: Install build deps
109110
run: |

src/veedb/apitypes/common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@
139139

140140
@dataclass
141141
class ImageCommon:
142-
id: VNDBID
143-
url: str
144-
dims: List[int] # [width, height]
145-
sexual: float # 0.0-2.0 (average flagging vote)
146-
violence: float # 0.0-2.0 (average flagging vote)
147-
votecount: int
142+
id: Optional[VNDBID]
143+
url: Optional[str]
144+
dims: Optional[List[int]] # [width, height]
145+
sexual: Optional[float] # 0.0-2.0 (average flagging vote)
146+
violence: Optional[float] # 0.0-2.0 (average flagging vote)
147+
votecount: Optional[int]
148148

149149

150150
@dataclass

src/veedb/apitypes/entities/vn.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ class VNTitle:
3434
@dataclass
3535
class VNImageInfo(ImageCommon): # For vn.image and vn.screenshots
3636
thumbnail: Optional[str] = None
37-
thumbnail_dims: Optional[Tuple[int, int]] = None
38-
# For screenshots, 'release' can be a nested object.
39-
# Using Dict[str, Any] for simplicity, or define a VNScreenshotReleaseInfo
37+
4038
release: Optional[Dict[str, Any]] = (
4139
None # e.g. {'id': 'r123', 'title': 'Release Title'}
4240
)
@@ -47,8 +45,7 @@ class VNRelation: # vn.relations
4745
id: VNDBID # The related VN's ID
4846
relation: str # e.g., "preq", "seq", "alt", "side", "par", "ser", "fan", "orig"
4947
relation_official: bool
50-
# Other VN fields can be selected here via dot notation in the 'fields' query param
51-
# Example: title of the related VN
48+
5249
title: Optional[str] = None
5350
original_language: Optional[LanguageEnum] = None # Example: olang of related VN
5451

0 commit comments

Comments
 (0)