mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #30] Fix __version__ to read from package metadata instead of hardcoded string #90
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/30
Author: @davidmoserai
Created: 2/22/2026
Status: 🔄 Open
Base:
main← Head:fix/version-from-metadata📝 Commits (1)
1ce2658Fix version to read from package metadata instead of hardcoded string📊 Changes
2 files changed (+6 additions, -3 deletions)
View changed files
📝
comfy_kitchen/__init__.py(+6 -1)📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+0 -2)📄 Description
Problem
comfy_kitchen.__version__reports"0.1.0"regardless of the actual installed version. This has been the case since the first release — the version string was hardcoded in two places and never updated during any version bump:Every version bump commit (0.1.6 → 0.2.0, 0.2.2, 0.2.3, 0.2.5, 0.2.6, 0.2.7) only modified
pyproject.toml, leaving these hardcoded strings unchanged.Real-world impact
This caused significant debugging confusion in our production inference pipeline. When investigating CUDA backend issues, our startup diagnostics reported
comfy-kitchen 0.1.0at runtime. Since version 0.1.0 was the initial release with known limitations, we spent considerable time trying to force-upgrade the package — only to discover thatpip show comfy-kitchencorrectly reported 0.2.7 all along. The__version__attribute was simply wrong.The mismatch between
importlib.metadata.version("comfy-kitchen")(correct:0.2.7) andcomfy_kitchen.__version__(wrong:0.1.0) is confusing for anyone doing version checks or runtime diagnostics.Fix
comfy_kitchen/__init__.py: Replace the hardcoded string withimportlib.metadata.version(), which reads from the package metadata set bypyproject.toml— the single source of truth. Includes aPackageNotFoundErrorfallback for editable/dev installs.dlpack_bindings.cpp: Removed the hardcodedm.attr("__version__") = "0.1.0"from the C++ nanobind module. The Python-level__version__is the canonical source, and nobody accesses_C.__version__directly.This is the recommended approach for single-sourcing the package version in modern Python packaging.
Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.