LITE-33583 Fix Homebrew installation crashing on missing pkg_resources#247
Merged
Merged
Conversation
The `brew install cloudblue/connect/connect-cli` produced a binary that crashed on every invocation with "ModuleNotFoundError: No module named 'pkg_resources'". Root cause: setuptools 81 removed the legacy pkg_resources module, and the brew virtualenv ended up with setuptools 82. Several runtime dependencies (interrogatio, and the now-removed fs) import pkg_resources at module load time, so loading the CLI plugins aborted immediately. - Pin setuptools to <81 as an explicit runtime dependency so the generated Homebrew formula installs a setuptools that still ships pkg_resources. This is the actual fix for the broken brew install. - Drop the archived fs (pyfilesystem2) dependency, which also relied on pkg_resources: replace TempFS with stdlib tempfile.TemporaryDirectory in the product cloner and back the test fs fixture with pytest's tmp_path. This removes fs and its transitive appdirs from the lock file. Verified by installing the built wheel into a clean python@3.10 venv seeded with setuptools 82: the constraint downgraded setuptools to 80.10.2 and `ccli --version` runs successfully.
|
|
|
arnaugiralt
approved these changes
Jun 26, 2026
arnaugiralt
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for unblocking this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
brew install cloudblue/connect/connect-cliproduced a binary that crashed on every invocation with:Root cause
setuptools 81 removed the legacy
pkg_resourcesmodule, and the Homebrew virtualenv ended up with setuptools 82. Several runtime dependencies (interrogatio, and the now-removedfs) importpkg_resourcesat module load time, so loading the CLI plugins aborted immediately.Changes
setuptools < 81as an explicit runtime dependency so the generated Homebrew formula installs a setuptools that still shipspkg_resources. This is the actual fix for the broken install.fs(pyfilesystem2) dependency, which also relied onpkg_resources: replaceTempFSwith stdlibtempfile.TemporaryDirectoryin the product cloner and back the testfsfixture with pytest'stmp_path. This removesfsand its transitiveappdirsfrom the lock file.Verification
Built the wheel and installed it into a clean
python@3.10venv seeded with setuptools 82: the constraint downgraded setuptools to 80.10.2 automatically andccli --versionruns successfully. Full test suite: 444 passed (the only errors are a pre-existing host-only weasyprint/gobject native-lib issue, unrelated).Follow-up
The
setuptools < 81pin is a temporary unblock. The forward fix (tracked separately) is to bumpinterrogatio >= 2.4.0— which already migrated offpkg_resources— onceconnect-openapi-clientrelaxes its spuriousimportlib-metadata < 7pin. At that point the setuptools pin can be removed.