introdue version info

This commit is contained in:
tianzi
2024-08-25 19:55:23 +01:00
parent 660cfa2b00
commit 35170bc4b9
4 changed files with 52 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
[bumpversion]
current_version = 1.0.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize = {major}.{minor}.{patch}
[bumpversion:file:__init__.py]
[bumpversion:file:CHANGELOG.md]
search = Unreleased
replace = {new_version} - {now:%Y-%m-%d}
+13
View File
@@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Initial release of ComfyUI-Web-Viewer
- Web Viewer node with customizable URL input
- Configurable window size for the Web Viewer
+3
View File
@@ -2,6 +2,8 @@ from .nodes.web_viewer_node import WebViewerNode
from .nodes.image_saver_node import ImageSaverNode
from .nodes.audio_genres_node import AudioGenresNode
__version__ = "1.0.0"
NODE_CLASS_MAPPINGS = {
"WebViewerNode": WebViewerNode,
"ImageSaverNode": ImageSaverNode,
@@ -18,3 +20,4 @@ NODE_DISPLAY_NAME_MAPPINGS = {
WEB_DIRECTORY = "./web/comfyui"
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
+24
View File
@@ -0,0 +1,24 @@
import subprocess
import sys
def update_version(version_part):
try:
subprocess.run(['bump2version', version_part], check=True)
print(f"Version updated successfully. New version: {get_current_version()}")
except subprocess.CalledProcessError as e:
print(f"Error updating version: {e}")
sys.exit(1)
def get_current_version():
with open('__init__.py', 'r') as f:
for line in f:
if line.startswith('__version__'):
return line.split('=')[1].strip().strip('"')
return "Unknown"
if __name__ == "__main__":
if len(sys.argv) != 2 or sys.argv[1] not in ['major', 'minor', 'patch']:
print("Usage: python update_version.py [major|minor|patch]")
sys.exit(1)
update_version(sys.argv[1])