diff --git a/README.md b/README.md index e465b25..a845875 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ git clone https://github.com/StyleRef/styleref-comfyui ``` Restart ComfyUI. No dependencies to install — the pack uses only the Python -standard library. Look for `[StyleRef] v0.1.0 — 5 nodes registered` in the +standard library. Look for `[StyleRef] v1.0.0 — 5 nodes registered` in the server console at startup. ## 60-second quickstart diff --git a/__init__.py b/__init__.py index b0da6e7..d305b96 100644 --- a/__init__.py +++ b/__init__.py @@ -46,7 +46,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { # progressive enhancement. Nothing here is required for the nodes to work. WEB_DIRECTORY = "./web" -_FALLBACK_VERSION = "0.1.0" +_FALLBACK_VERSION = "1.0.0" def _pack_version() -> str: diff --git a/pyproject.toml b/pyproject.toml index ded131d..74fb0c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "styleref-comfyui" -version = "0.1.0" +version = "1.0.0" description = "Load StyleRef creative styles as ComfyUI nodes — define a style once, reuse it across FLUX, SDXL, and SD1.5." authors = [{ name = "StyleRef", email = "hello@styleref.io" }] readme = "README.md" diff --git a/styleref_api.py b/styleref_api.py index a56c04f..07cb606 100644 --- a/styleref_api.py +++ b/styleref_api.py @@ -25,7 +25,7 @@ SITE_URL = "https://styleref.io" # Identifies this surface in StyleRef's API telemetry (recordApiCall reads it). CLIENT_TAG = "comfyui" -USER_AGENT = "styleref-comfyui/0.1.0 (+https://styleref.io)" +USER_AGENT = "styleref-comfyui/1.0.0 (+https://styleref.io)" DEFAULT_TIMEOUT_S = 30 diff --git a/tests/test_api.py b/tests/test_api.py index 01c5635..847af3f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -2,8 +2,11 @@ from __future__ import annotations +import importlib import io import json +import os +import re import urllib.error import pytest @@ -359,3 +362,26 @@ def test_get_style_spec_returns_etag_on_200(monkeypatch): spec, _url, etag = api.get_style_spec("abc") assert spec["name"] == "Warm" assert etag == 'W/"e2"' + + +# ── version strings stay in sync ───────────────────────────────────────────── + + +def test_version_strings_agree_with_pyproject(): + """ + The version lives in three places: pyproject (which the Registry publishes + and the release workflow checks the tag against), the User-Agent this client + sends, and __init__'s fallback for when pyproject cannot be read. Only the + first is enforced by anything, so the other two drift silently and the + telemetry then attributes traffic to a version nobody is running. + """ + root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + with open(os.path.join(root, "pyproject.toml"), encoding="utf-8") as fh: + declared = re.search(r'^version\s*=\s*"([^"]+)"', fh.read(), re.MULTILINE).group(1) + + assert f"styleref-comfyui/{declared} " in api.USER_AGENT, ( + f"USER_AGENT is {api.USER_AGENT!r}, pyproject says {declared}" + ) + + pack = importlib.import_module("__init__") + assert declared == pack._FALLBACK_VERSION