Skip to content

Commit

Permalink
automatic version
Browse files Browse the repository at this point in the history
  • Loading branch information
crystian committed Jan 8, 2024
1 parent e164887 commit b10a562
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 19 deletions.
30 changes: 23 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,36 @@ assignees: ''

---

**Describe the bug**
**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
**To Reproduce**
__Please attach a workflow file to make it easier for others to reproduce the error!__

**Expected behavior**
**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version:**
- ComfyUI Version
**Error in console:**
If applicable, add the error message from the console.

**Additional context**
**Versions:**
Copy the output of the console (4 parts), like this:
```
** Platform: Windows
** Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
```
```
Total VRAM 12287 MB, total RAM 130996 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3080 Ti : cudaMallocAsync
```
```
### Loading: ComfyUI-Manager (V1.25.3)
### ComfyUI Revision: 1886 [6a10640f] | Released on '2024-01-08'
```

**Additional context**
Add any other context about the problem here.
6 changes: 6 additions & 0 deletions .others/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
python .others/version.py

git add __init__.py

exit 0
33 changes: 33 additions & 0 deletions .others/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import os

print("-- Setting up the version --")

versionLabel = "@version:"
version_file = os.path.join(os.path.dirname(__file__), "../version")

with open(version_file, "r") as f:
version = f.read().strip()

if version is None or version == "":
raise RuntimeError(f"File without version: {version_file}")

print(f"Version to set: {version}")

# modify the __init__.py file with @version
file1 = os.path.join(os.path.dirname(__file__), "../__init__.py")
print(f"> File1: {file1}")

file1VersionFound = False
# lines = None
with open(file1, "r") as f:
lines = f.readlines()
for line in lines:
if versionLabel in line:
file1VersionFound = True
lines[lines.index(line)] = f"{versionLabel} {version}\n"

if not file1VersionFound:
raise RuntimeError(f"Version label not found in file: {file1}")

with open(file1, "w") as f2:
f2.writelines(lines)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ If you want to see the metadata, you can use the "[Crystools](https://github.com

* I used a specific field in metadata/json: "workflow.extra." I've created an "info" property to store this information. I don't know, and I haven't found any documentation about this, so I hope it's not a problem.

## Changelog

Because it is the same project for me, I will use the same changelog on that project [ComfyUI-Crystools](https://github.com/crystian/ComfyUI-Crystools?tab=readme-ov-file#changelog).

## Installation

Expand Down
24 changes: 12 additions & 12 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
@author: Crystian
@title: Crystools-save
@nickname: Crystools-save
@version: 1.0.0
@project: "https://github.com/crystian/ComfyUI-Crystools-save",
@description: With this quality of life extension, you can save your workflow with a specific name and include additional details such as the author, a description, and the version (in metadata/json) IG: https://www.instagram.com/crystian.ia
"""

WEB_DIRECTORY = "web"
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
"""
@author: Crystian
@title: Crystools-save
@nickname: Crystools-save
@version: 1.1.0
@project: "https://github.com/crystian/ComfyUI-Crystools-save",
@description: With this quality of life extension, you can save your workflow with a specific name and include additional details such as the author, a description, and the version (in metadata/json) IG: https://www.instagram.com/crystian.ia
"""

WEB_DIRECTORY = "web"
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.0

0 comments on commit b10a562

Please sign in to comment.