Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pyproject.toml #6386

Merged
merged 11 commits into from
Jan 11, 2025
Merged

Add pyproject.toml #6386

merged 11 commits into from
Jan 11, 2025

Conversation

huchenlei
Copy link
Collaborator

@huchenlei huchenlei commented Jan 7, 2025

This PR adds pyproject.toml file to track ComfyUI version. Previous method relies on git being installed in the local system and the project is distributed as a git repo, which is not true for https://github.com/Comfy-Org/desktop.

After this PR, please update project.version each time a new version tag is created. Custom nodes can now do from comfyui_version import __version__ to get ComfyUI's version.

Some follow-up tasks:

  • Merge ruff.toml to pyproject.toml's tools.ruff section
  • Merge requirement.txt to dependencies / optional_dependencies sections. (When dependency is updated, a new github action will auto generate requirements.txt)
  • Track stable build metadata (cuda version / python version) in a special metadata field and trigger stable-release.yml when version in pyproject.toml is changed.

Note:
toml library is added as Python's official support for toml(tomllib) is added in 3.11.

Reference:

robinjhuang
robinjhuang previously approved these changes Jan 7, 2025
@catboxanon
Copy link
Contributor

Should there be concern for users not using Comfy-Org/desktop since this would be removing the additional info provided by git describe --tags?

@huchenlei
Copy link
Collaborator Author

Should there be concern for users not using Comfy-Org/desktop since this would be removing the additional info provided by git describe --tags?

There is definitely a behaviour change, but I don't think there is any extension currently referencing the comfyui_version in /system_stats API according to codesearch.

https://cs.comfy.org/search?q=context:global+comfyui_version&patternType=keyword&sm=0

@catboxanon
Copy link
Contributor

catboxanon commented Jan 8, 2025

That link requires a login but I'll take your word for it.

My concern was more into regards to bug reporting -- users using git (more or less everybody currently, except for early desktop beta adopters) who may report bugs inbetween stable releases and may mistakenly report the incorrect version number by reporting only what's shown in the UI -- but that can be resolved in other ways.

@huchenlei
Copy link
Collaborator Author

huchenlei commented Jan 8, 2025

Offline discussion with @comfyanonymous:

  • Drop the toml library dependency
  • Add a github action that autogenerates a version.py file which defines __version__ from toml version change

@huchenlei
Copy link
Collaborator Author

huchenlei commented Jan 8, 2025

Note: The update action verified to be working on #6404
image

@bigcat88
Copy link
Contributor

bigcat88 commented Jan 10, 2025

  • Add a github action that autogenerates a version.py

just note: usual approach is to name it _version.py or {project_name}_version.py(e.g.: comfy_version.py), to not conflict with version namespace which can be quite common.

@comfyanonymous comfyanonymous merged commit 9c773a2 into comfyanonymous:master Jan 11, 2025
6 checks passed
@huchenlei huchenlei deleted the pyproject branch January 11, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants