[PR #25] [MERGED] fix: derive __version__ from dist metadata instead of hardcoding it #33

Closed
opened 2026-10-31 22:00:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/25
Author: @robinjhuang
Created: 7/30/2026
Status: ✅ Merged
Merged: 7/30/2026
Merged by: @wei-hai

Base: main ← Head: fix/version-single-source


📝 Commits (2)

  • 665cd76 fix: derive version from dist metadata instead of hardcoding it
  • 37e38ad test: inject the version instead of asserting against the ambient install

📊 Changes

2 files changed (+63 additions, -1 deletions)

View changed files

📝 src/comfy_sdk/__init__.py (+10 -1)
➕ tests/test_version.py (+53 -0)

📄 Description

publish.yml stamps the release tag into pyproject.toml at build time and nowhere else, so the hardcoded __version__ = "0.1.0" in comfy_sdk/__init__.py would have reported the placeholder on every published release — while the wheel metadata and the User-Agent (which already reads dist metadata) reported the real version.

Verified by building with an injected 9.9.9: __version__ and the User-Agent now agree, where before __version__ stayed 0.1.0. Adds a regression test.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-python-sdk/pull/25 **Author:** [@robinjhuang](https://github.com/robinjhuang) **Created:** 7/30/2026 **Status:** ✅ Merged **Merged:** 7/30/2026 **Merged by:** [@wei-hai](https://github.com/wei-hai) **Base:** `main` ← **Head:** `fix/version-single-source` --- ### 📝 Commits (2) - [`665cd76`](https://github.com/Comfy-Org/comfy-python-sdk/commit/665cd76d74420d8276c2f9f9eb5b4ea4fedb49e1) fix: derive __version__ from dist metadata instead of hardcoding it - [`37e38ad`](https://github.com/Comfy-Org/comfy-python-sdk/commit/37e38ad6157570b9fe064b9f4e2c286399f5a6fd) test: inject the version instead of asserting against the ambient install ### 📊 Changes **2 files changed** (+63 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/comfy_sdk/__init__.py` (+10 -1) ➕ `tests/test_version.py` (+53 -0) </details> ### 📄 Description `publish.yml` stamps the release tag into `pyproject.toml` at build time and nowhere else, so the hardcoded `__version__ = "0.1.0"` in `comfy_sdk/__init__.py` would have reported the placeholder on every published release — while the wheel metadata and the User-Agent (which already reads dist metadata) reported the real version. Verified by building with an injected `9.9.9`: `__version__` and the User-Agent now agree, where before `__version__` stayed `0.1.0`. Adds a regression test. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 22:00:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-python-sdk#33
No description provided.