A folder in custom_nodes with neither .git nor .tracking, left by an
install that broke midway or by a download unpacked by hand, was taken for
a git nodepack: Update All logged "ERROR: An error occurred while updating
..." for it, and its nodepack showed as not installed (#3330).
It is now an invalid installation. Update All and cm-cli update all leave
it alone, the Custom Nodes Manager marks its row INVALID INSTALLATION and
offers Reinstall, /customnode/installed lists it with
invalid_installation: true, and the startup notice names it. By its folder
name it is enabled, disabled and uninstalled as before. An update of the
nodepack alone fails with the guidance to reinstall it, and the console
line of a failed update says why the update failed.
A reinstall, of any nodepack, keeps the folders it replaces until the new
installation is in place, and puts them back when the install fails. It
deleted them first, so a failed download lost the nodepack. cm-cli
reinstall makes the same reinstall and prints [REINSTALLED].
What is in the way of a reinstall, such as a clone of a fork at the install
path or under the name of the nodepack, is moved to
custom_nodes/.disabled/.archived/ and the log says where it is. It is not
deleted and no longer loaded, and it goes back when the install fails. The
reinstall failed there with "Install path already exists".
A requirement that is a URL, as git+https://github.com/owner/repo or the
URL of a wheel, names no package, so is_installed() of the startup script
never found it installed and pip was run for it at every reserved install
of its nodepack: for a repository, a clone and a build (#3575). On Windows,
or with always_lazy_install, every install, update and fix that the server
is asked for is reserved.
pip and uv record where a distribution came from in its direct_url.json
(PEP 610). installed_from() compares the URL with those records, and
is_installed() skips the requirement when a distribution installed from
that URL is there and no distribution of its name differs from it. The
repository is not asked, so a branch that has moved on is not followed, as
a name without a version is not upgraded.
A fix is the way to have such a package installed again. fix_cmd() builds
a forced command for a URL requirement: --force-reinstall --no-deps, and
without the cache of the installer, since with it uv installs the wheel it
has built of a commit before, forced or not, and so does pip for a name
with a commit. The command is run at once or reserved as any other.
Wherever it is run, reinstall() runs it in two steps: the requirement as
an install does it, which brings what the package needs now, and then the
forced command, which puts a clean copy there. When only the forced step
fails, what is installed stays. When the first step fails and the
repository does not answer `git ls-remote`, uv is asked for the installed
commit with --offline: the one use of a cache.
A fix is no longer held back by what the session has processed, only by
what the same fix has done, and one `cm-cli fix` of several nodepacks
shares that between them.
Five changes, each in the CHANGELOG.
- On a ComfyUI without the System User API, refuse every route but the
update of ComfyUI, leave a scheduled restore and the pip files of the
unprotected directory alone, and migrate only the settings that are
preferences
- Refuse there in the security gate, not by changing the security level
that was read
- After the update, install the requirements of ComfyUI in prestartup,
and keep a backup of the legacy directory that is already there
- Read config.ini values as plain text and default the invalid ones
- Report a failed legacy backup without its error text
Reported by:
- anir0y
Three fixes. The CHANGELOG has an entry for each.
- Give the scheduled snapshot restore the directories of the server
- Report the failed steps of a snapshot restore, check a cloned node pack
out at the pinned commit and run the install step of the node packs it
installs
- Write what is reserved for the next start as UTF-8, and remove the files of
an old version from the node pack, and from nowhere else, when a version is
switched; read the list of those files as UTF-8
Four fixes. The CHANGELOG has an entry for each.
- Use the git executable set as git_exe
- Read the commit of a node pack whose refs are packed, and bring its
submodules to the commit that is checked out
- Start with a node pack whose .git/config cannot be read
- Fail an update whose pull or submodule update failed, and undo the pull
Port the pip requirement checks of manager-v4 (#3489) to main, so that
both branches decide with the same code. #3431 had only replaced the
version class in main's own checks, which left ">" and "~=" answered
differently from v4.
- Parse requirements with packaging and share one parser and one
downgrade decision between manager_core and the startup check
- Treat '-', '_' and '.' as one separator in package names, in the
installed-package lookup, both lists, requirements and
pip_auto_fix.list (#3458)
- Read every version clause, so a lower bound written first no longer
hides an upper bound; read spaces, parentheses, markers, '===' and
direct references
- Install a requirement with extras unless it would downgrade the
protected package
- Check the requirement of every pip install command form, including
those with --index-url, on the immediate and reserved paths
- Skip a protected package when the requirement cannot be compared and
log why and how to install it
- At startup, recognize an installed package however its requirement
spells the name, install one older than its '~=' version or at the
version that '>' excludes, and stop reinstalling the '~=' version
itself
- Read downgrade_blacklist from config.ini in cm-cli, which read a
path attribute that does not exist and so protected only the
built-in packages
- Remove the unused is_installed copy from manager_core and the
pip_version helper that #3431 added
- Import packaging where it is used, because prestartup_script imports
manager_util before it installs missing dependencies
- Add the tests of #3489, adapted to main, and tests for the startup
loop, '>', pip_auto_fix.list names and the cm-cli setting; update
README and CHANGELOG
manager-v4 needs no counterpart: it has this code since #3489.
fixed: Update all - Properly display the results of the ComfyUI update.
fixed: Update all - An issue where the action results of the custom nodes manager were reflected in the main dialog.
https://github.com/ltdrdata/ComfyUI-Manager/issues/1548
fixed: invalid environment setup for git_helper.py
fixed: default pip overrides doesn't work
modified: git_helper.py - use GIT_EXE_PATH env instead of config.ini
improved: print user_directory and ComfyUI-Manager config path on startup
This commit addresses the NameError that occurs in the get_custom_nodes_paths method of the Ctx class. The error was caused by the folder_paths module not being properly imported or accessible within the static method. The fix involves the following changes:
1. Add a class variable folder_paths to the Ctx class.
2. Import the folder_paths module in the __init__ method using importlib.
3. Update the get_custom_nodes_paths method to use the class variable.
4. Add error handling to gracefully handle cases where the folder_paths module cannot be imported.
These changes ensure that the folder_paths module is properly imported and accessible within the Ctx class, resolving the NameError and improving the overall stability of the ComfyUI-Manager CLI tool.
Co-authored-by: yhayano-ponotech <yhayano.biz@gmail.com>
* Hacky: hide the features we do not want to ship with electron app
* Backup
* Take install path for cm-cli.
* Remove unused.
* Add no deps.
* Add no deps.
* Bypass ComfyUI version check when in electron env
* Fix exception when comfyui is not repo
* Fix version reporting always skipped
* Log unhandled errors
---------
Co-authored-by: Yoland Y <4950057+yoland68@users.noreply.github.com>
Co-authored-by: Robin Huang <robin.j.huang@gmail.com>
- print invalid installation nodes on terminal
(installed by `comfy registryinstall`)
- show only 'reinstall' menu if invalid installation node in gui
(and show INVALID marker)
This allows nodes to be pulled from git repositories that:
1. Require authentication
2. Are located on a computer that does not have any special software
beyond an SSH server to serve up git repos
3. Are hosted on sites that exclusively allow SSH access
I have also cleaned up the JavaScript regex for identifying valid HTTP
addresses. Due to an unescaped '.' and the lack of a count on the first
group, it wasn't doing a whole lot anyway -- just checking that the very
first character wasn't invalid.