Repository: Delgan/loguru
Pull request #1290 (2025-02-01 14:46:55)

Bump tox from 4.23.2 to 4.24.1
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some time.

Note: if you make any changes to this PR yourself, they will take precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [tox](https://github.com/tox-dev/tox) from 4.23.2 to 4.24.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tox-dev/tox/releases">tox's releases</a>.</em></p>
<blockquote>
<h2>4.24.1</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<ul>
<li>Adds ability to configure stderr output color by <a href="https://github.com/ssbarnea"><code>@​ssbarnea</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3426">tox-dev/tox#3426</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/tox-dev/tox/compare/4.24.0...4.24.1">https://github.com/tox-dev/tox/compare/4.24.0...4.24.1</a></p>
<h2>4.24.0</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<ul>
<li>fix docs config typo by <a href="https://github.com/wooshaun53"><code>@​wooshaun53</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3424">tox-dev/tox#3424</a></li>
<li>Allow users to disable use of pre-commit-uv by <a href="https://github.com/ssbarnea"><code>@​ssbarnea</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3430">tox-dev/tox#3430</a></li>
<li>Pass nix-ld related variables by default in pass_env (fixes <a href="https://redirect.github.com/tox-dev/tox/issues/3425">#3425</a>) by <a href="https://github.com/albertodonato"><code>@​albertodonato</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3434">tox-dev/tox#3434</a></li>
<li>Improve testenv docs consistency by <a href="https://github.com/thatch"><code>@​thatch</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3440">tox-dev/tox#3440</a></li>
<li>Display exception name when subprocesses raise them by <a href="https://github.com/ssbarnea"><code>@​ssbarnea</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3450">tox-dev/tox#3450</a></li>
<li>Fix the CI after setuptools 75.6 change by <a href="https://github.com/gaborbernat"><code>@​gaborbernat</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3452">tox-dev/tox#3452</a></li>
<li>Update pre-commit hooks with mypy fix by <a href="https://github.com/ssbarnea"><code>@​ssbarnea</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3454">tox-dev/tox#3454</a></li>
<li>Fix a typo in a code block in the User Guide by <a href="https://github.com/bryant1410"><code>@​bryant1410</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3462">tox-dev/tox#3462</a></li>
<li>Update pre-commit hooks by <a href="https://github.com/ssbarnea"><code>@​ssbarnea</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3460">tox-dev/tox#3460</a></li>
<li>💅 Make SVG image compatible with Firefox by <a href="https://github.com/webknjaz"><code>@​webknjaz</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3466">tox-dev/tox#3466</a></li>
<li>feat: adding a json schema command by <a href="https://github.com/henryiii"><code>@​henryiii</code></a> in <a href="https://redirect.github.com/tox-dev/tox/pull/3446">tox-dev/tox#3446</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/wooshaun53"><code>@​wooshaun53</code></a> made their first contribution in <a href="https://redirect.github.com/tox-dev/tox/pull/3424">tox-dev/tox#3424</a></li>
<li><a href="https://github.com/albertodonato"><code>@​albertodonato</code></a> made their first contribution in <a href="https://redirect.github.com/tox-dev/tox/pull/3434">tox-dev/tox#3434</a></li>
<li><a href="https://github.com/thatch"><code>@​thatch</code></a> made their first contribution in <a href="https://redirect.github.com/tox-dev/tox/pull/3440">tox-dev/tox#3440</a></li>
<li><a href="https://github.com/bryant1410"><code>@​bryant1410</code></a> made their first contribution in <a href="https://redirect.github.com/tox-dev/tox/pull/3462">tox-dev/tox#3462</a></li>
<li><a href="https://github.com/henryiii"><code>@​henryiii</code></a> made their first contribution in <a href="https://redirect.github.com/tox-dev/tox/pull/3446">tox-dev/tox#3446</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/tox-dev/tox/compare/4.23.2...4.24.0">https://github.com/tox-dev/tox/compare/4.23.2...4.24.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/tox-dev/tox/blob/main/docs/changelog.rst">tox's changelog</a>.</em></p>
<blockquote>
<h2>v4.24.1 (2025-01-21)</h2>
<p>Misc - 4.24.1</p>
<pre><code>- :issue:`3426`
<h2>v4.24.0 (2025-01-21)</h2>
<p>Features - 4.24.0
</code></pre></p>
<ul>
<li>
<p>Add a <code>schema</code> command to produce a JSON Schema for tox and the current plugins.</p>
<ul>
<li>by :user:<code>henryiii</code> (:issue:<code>3446</code>)</li>
</ul>
</li>
</ul>
<p>Bugfixes - 4.24.0</p>
<pre><code>- Log exception name when subprocess execution produces one.
<ul>
<li>by :user:<code>ssbarnea</code> (:issue:<code>3450</code>)</li>
</ul>
<p>Improved Documentation - 4.24.0
</code></pre></p>
<ul>
<li>
<p>Fix typo in <code>docs/config.rst</code> from <code>{}</code> to <code>{:}</code>.</p>
<ul>
<li>by :user:<code>wooshaun53</code> (:issue:<code>3424</code>)</li>
</ul>
</li>
<li>
<p>Pass <code>NIX_LD</code> and <code>NIX_LD_LIBRARY_PATH</code> variables by default in <code>pass_env</code> to make generic binaries work under Nix/NixOS.</p>
<ul>
<li>by :user:<code>albertodonato</code> (:issue:<code>3425</code>)</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/tox-dev/tox/commit/d4276dc0b6096811547848cc9ab245920db639cb"><code>d4276dc</code></a> release 4.24.1</li>
<li><a href="https://github.com/tox-dev/tox/commit/ee660b96bdcf527f4706c9e406d25e1dcb54048b"><code>ee660b9</code></a> Adds ability to configure stderr output color (<a href="https://redirect.github.com/tox-dev/tox/issues/3426">#3426</a>)</li>
<li><a href="https://github.com/tox-dev/tox/commit/eca61ed6ce1f24836b51a42496304ba42ae4a6cd"><code>eca61ed</code></a> release 4.24.0</li>
<li><a href="https://github.com/tox-dev/tox/commit/bbd966361b28119d9b0097e0d48299b888596828"><code>bbd9663</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/tox-dev/tox/issues/3464">#3464</a>)</li>
<li><a href="https://github.com/tox-dev/tox/commit/825c68bf266ef466523f494a96b45fc0e943de35"><code>825c68b</code></a> feat: adding a json schema command (<a href="https://redirect.github.com/tox-dev/tox/issues/3446">#3446</a>)</li>
<li><a href="https://github.com/tox-dev/tox/commit/fccbe2a6cf4e23edeb8eb78030fdfc2fcfdd0e1d"><code>fccbe2a</code></a> 💅 Make SVG image compatible with Firefox (<a href="https://redirect.github.com/tox-dev/tox/issues/3466">#3466</a>)</li>
<li><a href="https://github.com/tox-dev/tox/commit/e3e77a6f711f0c333aea10eb2bc8794c6215c637"><code>e3e77a6</code></a> Bump astral-sh/setup-uv from 4 to 5 (<a href="https://redirect.github.com/tox-dev/tox/issues/3463">#3463</a>)</li>
<li><a href="https://github.com/tox-dev/tox/commit/c0b490d6668b0aa9c531087b23b24691bfe49f9c"><code>c0b490d</code></a> Update pre-commit hooks (<a href="https://redirect.github.com/tox-dev/tox/issues/3460">#3460</a>)</li>
<li><a href="https://github.com/tox-dev/tox/commit/fbac0786536f682ccb5facfafa1eed6e8b5ac18e"><code>fbac078</code></a> Fix a typo in a code block in the User Guide (<a href="https://redirect.github.com/tox-dev/tox/issues/3462">#3462</a>)</li>
<li><a href="https://github.com/tox-dev/tox/commit/c7f2cafff187cf4895964ad066fb3548fe42ad1a"><code>c7f2caf</code></a> Bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 (<a href="https://redirect.github.com/tox-dev/tox/issues/3459">#3459</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/tox-dev/tox/compare/4.23.2...4.24.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tox&package-manager=pip&previous-version=4.23.2&new-version=4.24.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 901f511..5adf50f 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,7 +4,7 @@
 - Fix a regression preventing formatting of ``record["time"]`` when using ``zoneinfo.ZoneInfo`` timezones (`#1260 <https://github.com/Delgan/loguru/pull/1260>`_, thanks `@bijlpieter <https://github.com/bijlpieter>`_).
 - Allow the ``rotation`` argument of file sinks to accept a list of rotation conditions, any of which can trigger the rotation (`#1174 <https://github.com/Delgan/loguru/issues/1174>`_, thanks `@CollinHeist <https://github.com/CollinHeist>`_).
 - Update the default log format to include the timezone offset since it produces less ambiguous logs (`#856 <https://github.com/Delgan/loguru/pull/856>`_, thanks `@tim-x-y-z <https://github.com/tim-x-y-z>`_).
-
+- Add requirement for ``$TERM`` not to be ``"dumb"`` to enable colorization (`#1287 <https://github.com/Delgan/loguru/pull/1287>`_, thanks `@snosov1 <https://github.com/snosov1>`_).
 
 `0.7.3`_ (2024-12-06)
 =====================
diff --git a/loguru/_colorama.py b/loguru/_colorama.py
index 3a93931..3f6db2f 100644
--- a/loguru/_colorama.py
+++ b/loguru/_colorama.py
@@ -29,6 +29,8 @@ def should_colorize(stream):
             return True
         if "PYCHARM_HOSTED" in os.environ:
             return True
+        if os.environ.get("TERM", "") in ("dumb",):
+            return False
         if os.name == "nt" and "TERM" in os.environ:
             return True
 
diff --git a/pyproject.toml b/pyproject.toml
index 32be443..7588929 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,9 +42,9 @@ requires-python = ">=3.5,<4.0"
 [project.optional-dependencies]
 dev = [
   # Setup.
-  "pre-commit==4.0.1 ; python_version>='3.9'",
+  "pre-commit==4.1.0 ; python_version>='3.9'",
   "tox==3.27.1 ; python_version<'3.8'",
-  "tox==4.23.2 ; python_version>='3.8'",
+  "tox==4.24.1 ; python_version>='3.8'",
   # Testing framework.
   "pytest==6.1.2 ; python_version<'3.8'",
   "pytest==8.3.2 ; python_version>='3.8'",
@@ -71,7 +71,7 @@ dev = [
   "myst-parser==4.0.0 ; python_version>='3.11'",
   # Packaging.
   "build==1.2.2 ; python_version>='3.11'",
-  "twine==6.0.1 ; python_version>='3.11'",
+  "twine==6.1.0 ; python_version>='3.11'",
 ]
 
 [project.urls]


Test patch:
diff --git a/tests/test_colorama.py b/tests/test_colorama.py
index cf98721..49a0d7f 100644
--- a/tests/test_colorama.py
+++ b/tests/test_colorama.py
@@ -135,6 +135,24 @@ def test_mintty_fixed_windows(monkeypatch, patched, expected):
         assert should_colorize(stream) is expected
 
 
+@pytest.mark.parametrize(
+    ("patched", "expected"),
+    [
+        ("__stdout__", False),
+        ("__stderr__", False),
+        ("stdout", True),
+        ("stderr", True),
+        ("", True),
+    ],
+)
+def test_dumb_term_not_colored(monkeypatch, patched, expected):
+    stream = StreamIsattyTrue()
+    with monkeypatch.context() as context:
+        context.setitem(os.environ, "TERM", "dumb")
+        context.setattr(sys, patched, stream, raising=False)
+        assert should_colorize(stream) is expected
+
+
 @pytest.mark.parametrize(
     ("patched", "expected"),
     [