From 279527302f7b20979e804b567ae577d75699c81b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 17 Sep 2026 09:53:18 -0300 Subject: [PATCH] EDEN-2904: Require click>=8.5.0, drop auto_wrap_for_ansi workaround click 8.5.0 removed colorama-based ANSI wrapping on Windows entirely (Windows now enables ANSI styles natively), which deleted `click.utils.auto_wrap_for_ansi` and broke deps_cli.py's monkeypatch of it. The workaround is no longer needed either: `click.echo(..., color=True)` already writes raw ANSI codes directly. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.rst | 10 ++++++++++ pyproject.toml | 6 +----- src/deps/deps_cli.py | 7 ------- uv.lock | 15 ++++----------- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3f5a335..59f17cc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,13 @@ +UNRELEASED +---------- + +* Require ``click>=8.5.0``. This drops a Windows-only workaround that monkey-patched + ``click.utils.auto_wrap_for_ansi`` to force raw ANSI codes through when ``--force-color`` + was used; click 8.5.0 removed its colorama-based wrapping on Windows entirely, which made + the attribute disappear (breaking ``deps`` on click 8.5.0+) and made the workaround + unnecessary, since ``echo()`` already writes raw ANSI codes when ``color=True`` is passed + explicitly. + 1.7.0 (2026-06-01) ------------------ diff --git a/pyproject.toml b/pyproject.toml index e8d5b3d..bc0b254 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,8 +12,7 @@ authors = [ ] requires-python = ">=3.10" dependencies = [ - "click>=7.0", - "colorama>=0.4", + "click>=8.5.0", "importlib-metadata>=8.7.0", "jinja2>=3.1", "pyyaml>=6.0.2", @@ -26,9 +25,6 @@ deps = "deps.deps_cli:main_func" [dependency-groups] dev = [ - # click 8.2.1 has a bug regarding bool flags and env vars: https://github.com/pallets/click/pull/2956 - # this breaks test_force_color in our test suite. - "click>=8.1,!=8.2.*", "pre-commit>=4.3.0", "pytest>=9.0.3", "pytest-mock>=3.14.1", diff --git a/src/deps/deps_cli.py b/src/deps/deps_cli.py index 8d0979b..51a9cc3 100644 --- a/src/deps/deps_cli.py +++ b/src/deps/deps_cli.py @@ -918,15 +918,9 @@ def cli( initial_time = time.time() global _click_echo_color - original_auto_wrap_for_ansi = click.utils.auto_wrap_for_ansi try: if force_color: _click_echo_color = True - if sys.platform == "win32": - # Click always wrap the output stream on windows calling - # `click.utils.auto_wrap_for_ansi`, setting to `None` causes ansi escape codes to - # be output. - click.utils.auto_wrap_for_ansi = None directories = find_directories(project) @@ -987,7 +981,6 @@ def required_files_filter(dependency: Dep, quiet: bool) -> bool: sys.exit(execution_return[-1] if execution_return else 1) finally: _click_echo_color = None - click.utils.auto_wrap_for_ansi = original_auto_wrap_for_ansi @contextmanager diff --git a/uv.lock b/uv.lock index 6748987..475dff2 100644 --- a/uv.lock +++ b/uv.lock @@ -13,14 +13,11 @@ wheels = [ [[package]] name = "click" -version = "8.1.8" +version = "8.5.0" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593, upload-time = "2024-12-21T18:38:44.339Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c7/0e/7fa0ef50764b67090eca4114772a2abf8b6148198475e54c660b97caeee6/click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34", size = 382235, upload-time = "2026-08-26T13:33:14.56Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/d4/7ebdbd03970677812aac39c869717059dbb71a4cfc033ca6e5221787892c/click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2", size = 98188, upload-time = "2024-12-21T18:38:41.666Z" }, + { url = "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360", size = 125251, upload-time = "2026-08-26T13:33:12.928Z" }, ] [[package]] @@ -38,7 +35,6 @@ version = "1.7.0" source = { editable = "." } dependencies = [ { name = "click" }, - { name = "colorama" }, { name = "importlib-metadata" }, { name = "jinja2" }, { name = "pyyaml" }, @@ -48,7 +44,6 @@ dependencies = [ [package.dev-dependencies] dev = [ - { name = "click" }, { name = "pre-commit" }, { name = "pytest" }, { name = "pytest-mock" }, @@ -56,8 +51,7 @@ dev = [ [package.metadata] requires-dist = [ - { name = "click", specifier = ">=7.0" }, - { name = "colorama", specifier = ">=0.4" }, + { name = "click", specifier = ">=8.5.0" }, { name = "importlib-metadata", specifier = ">=8.7.0" }, { name = "jinja2", specifier = ">=3.1" }, { name = "pyyaml", specifier = ">=6.0.2" }, @@ -67,7 +61,6 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ - { name = "click", specifier = ">=8.1,!=8.2.*" }, { name = "pre-commit", specifier = ">=4.3.0" }, { name = "pytest", specifier = ">=9.0.3" }, { name = "pytest-mock", specifier = ">=3.14.1" },