Skip to content

Drop redundant faust-cchardet from base image#417

Merged
frenck merged 1 commit into
masterfrom
drop-redundant-faust-cchardet
Jul 17, 2026
Merged

Drop redundant faust-cchardet from base image#417
frenck merged 1 commit into
masterfrom
drop-redundant-faust-cchardet

Conversation

@agners

@agners agners commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

Drop faust-cchardet from the base image's requirements.txt. It is a redundant explicit entry: faust-cchardet is a transitive dependency in Core, so it lands in the final image regardless of whether the base image installs it.

Why it's redundant

faust-cchardet is required by the axis and pytouchline_extended integration libraries, both of which declare it in their install_requires. Those integrations are part of requirements_all.txt, so faust-cchardet is pulled from the wheels index during the Core image build anyway.

Verified in a current Core image:

$ pip show faust-cchardet
Version: 2.1.19
Required-by: axis, pytouchline_extended

Contrast with the other three entries, which have no dependents and therefore must stay explicit:

$ pip show Brotli mysqlclient psycopg2
Brotli       Required-by:
mysqlclient  Required-by:
psycopg2     Required-by:

So faust-cchardet is the only one of the four that another package pulls in on its own.

Why it was here in the first place

It was originally provisioned in the base image because aiohttp used cchardet (and later its faust-cchardet fork) as an optional charset-detection speed-up — an extra, not a hard dependency, so it had to be installed explicitly. That's what #260 did when it replaced the abandoned cchardet. aiohttp 3.9 dropped built-in chardet/cchardet detection (charset resolution now defaults to UTF-8 unless a fallback_charset_resolver is configured), so that reason no longer applies. The only remaining consumers hard-declare the dependency, which is why the explicit entry can go.

Effect

  • The package remains in the final Core image (transitive via axis/pytouchline_extended), just installed in the Core layer instead of the base layer.
  • Its version is governed by Core's package_constraints (faust-cchardet>=2.1.18) rather than the pin removed here. (Separately, that constraint is worth tightening to an exact pin to match the grpcio/protobuf/numpy convention for build-from-source C-extensions — a Core-repo change.)

Context

This came out of investigating the failing Dependabot bump #416 (faust-cchardet 2.1.19 → 2.1.20). That bump failed only because of a PyPI upload race — the 2.1.20 sdist landed ~20 min after CI ran, and there is no cp314 wheel on PyPI, so HA builds it from source. It's since been built and published to the wheels index, so #416 would pass on rebase — but for the base image the entry is simply unnecessary. A matching cleanup removes the same unused pin from Supervisor's requirements.txt.

🤖 Generated with Claude Code

faust-cchardet is a transitive dependency in Core: it is required by the
axis and pytouchline_extended integration libraries, which declare it in
their install_requires. Those integrations are part of requirements_all.txt,
so faust-cchardet is pulled from the wheels index during the Core image
build regardless of whether the base image installs it explicitly.

It was originally provisioned here because aiohttp used cchardet (and later
its faust-cchardet fork) as an optional charset-detection speed-up, which is
an extra rather than a hard dependency and therefore had to be installed
explicitly (see #260, which replaced the abandoned cchardet). aiohttp 3.9
dropped built-in chardet/cchardet detection, so that reason no longer
applies, and the only remaining consumers hard-declare the dependency.

Unlike the other entries in requirements.txt, faust-cchardet has other
packages depending on it (Required-by: axis, pytouchline_extended), whereas
Brotli, mysqlclient and psycopg2 have no dependents and must stay explicit.
The package remains in the final Core image via transitive resolution; its
version is governed by Core's package_constraints (faust-cchardet>=2.1.18).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Thanks, @agners 👍

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck
frenck merged commit 7ba9113 into master Jul 17, 2026
8 checks passed
@frenck
frenck deleted the drop-redundant-faust-cchardet branch July 17, 2026 14:19
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.

3 participants