Skip to content

LITE-33583 Fix Homebrew installation crashing on missing pkg_resources#247

Merged
arnaugiralt merged 1 commit into
masterfrom
cr/LITE-33583-drop-fs-fix-brew-install
Jun 26, 2026
Merged

LITE-33583 Fix Homebrew installation crashing on missing pkg_resources#247
arnaugiralt merged 1 commit into
masterfrom
cr/LITE-33583-drop-fs-fix-brew-install

Conversation

@pcaro

@pcaro pcaro commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Problem

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 Homebrew 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.

Changes

  • Pin setuptools < 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 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.

Verification

Built the wheel and installed it into a clean python@3.10 venv seeded with setuptools 82: the constraint downgraded setuptools to 80.10.2 automatically and ccli --version runs 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 < 81 pin is a temporary unblock. The forward fix (tracked separately) is to bump interrogatio >= 2.4.0 — which already migrated off pkg_resources — once connect-openapi-client relaxes its spurious importlib-metadata < 7 pin. At that point the setuptools pin can be removed.

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.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@pcaro pcaro requested a review from arnaugiralt June 26, 2026 10:11
@sonarqubecloud

Copy link
Copy Markdown

@arnaugiralt arnaugiralt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for unblocking this

@arnaugiralt arnaugiralt merged commit b87fe4e into master Jun 26, 2026
4 checks passed
@arnaugiralt arnaugiralt deleted the cr/LITE-33583-drop-fs-fix-brew-install branch June 26, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants