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

Bump twine from 6.0.1 to 6.1.0
Bumps [twine](https://github.com/pypa/twine) from 6.0.1 to 6.1.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/pypa/twine/blob/main/docs/changelog.rst">twine's changelog</a>.</em></p>
<blockquote>
<h2>Twine 6.1.0 (2025-01-17)</h2>
<p>Features
^^^^^^^^</p>
<ul>
<li>Twine now has preliminary built-in support for
<code>Trusted Publishing &lt;https://docs.pypi.org/trusted-publishers/&gt;</code>_ as an
authentication mechanism. (<code>[#1194](https://github.com/pypa/twine/issues/1194) &lt;https://github.com/pypa/twine/pull/1194&gt;</code>_)</li>
</ul>
<p>Deprecations and Removals
^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>
<p>Remove support for <code>egg</code> and <code>wininst</code> distribution types. These are not
accepted by PyPI and not produced by any modern build-backends.
(<code>[#1195](https://github.com/pypa/twine/issues/1195) &lt;https://github.com/pypa/twine/issues/1195&gt;</code>_)</p>
</li>
<li>
<p>Twine no longer supports <code>.tar.bz2</code> source distributions.
(<code>[#1200](https://github.com/pypa/twine/issues/1200) &lt;https://github.com/pypa/twine/pull/1200&gt;</code>_)</p>
</li>
</ul>
<p>Misc
^^^^</p>
<ul>
<li>
<p><code>packaging</code> is used instead of <code>pkginfo</code> for parsing and validating
metadata. This aligns metadata validation to the one performed by PyPI.
<code>packaging</code> version 24.0 or later is required. Support for metadata
version 2.4 requires <code>packaging</code> 24.2 or later. <code>pkginfo</code> is not a
dependency anymore. (<code>[#1180](https://github.com/pypa/twine/issues/1180) &lt;https://github.com/pypa/twine/issues/1180&gt;</code>_)</p>
</li>
<li>
<p>Use <code>&quot;source&quot;</code> instead of <code>None</code> as <code>pyversion</code> for <code>sdist</code>
uploads. This is what PyPI (and most likely other package indexes)
expects. (<code>[#1191](https://github.com/pypa/twine/issues/1191) &lt;https://github.com/pypa/twine/issues/1191&gt;</code>_)</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pypa/twine/commit/aa3a910cdef8e0a3cb4e893f4c371b58015f52e0"><code>aa3a910</code></a> Update changelog for 6.1.0 (<a href="https://redirect.github.com/pypa/twine/issues/1214">#1214</a>)</li>
<li><a href="https://github.com/pypa/twine/commit/440603423ac579946aec0c15b280c6ef44477400"><code>4406034</code></a> Merge pull request <a href="https://redirect.github.com/pypa/twine/issues/1208">#1208</a> from dnicolodi/rm-setuptools</li>
<li><a href="https://github.com/pypa/twine/commit/2ca55db34c537bbcb00e157e407320c1e5f8f08b"><code>2ca55db</code></a> Simplify generation of test packages used in test_check</li>
<li><a href="https://github.com/pypa/twine/commit/bffd2963bbc9c321670eea659d30178000a7bae7"><code>bffd296</code></a> Move build_archive() from test_sdist to common helpers module</li>
<li><a href="https://github.com/pypa/twine/commit/fd0646e12e25752d136f9520d7af0d108bc1f29e"><code>fd0646e</code></a> Merge pull request <a href="https://redirect.github.com/pypa/twine/issues/1206">#1206</a> from dnicolodi/rm-binary-blobs-part1</li>
<li><a href="https://github.com/pypa/twine/commit/ab4ec8cc0f926a935070731246905f3985ff735d"><code>ab4ec8c</code></a> Merge pull request <a href="https://redirect.github.com/pypa/twine/issues/1211">#1211</a> from pypa/dependabot/github_actions/actions/upload-a...</li>
<li><a href="https://github.com/pypa/twine/commit/b562f7422403b0cadff694d2e81b98cf2e28894f"><code>b562f74</code></a> build(deps): bump actions/upload-artifact from 4.5.0 to 4.6.0</li>
<li><a href="https://github.com/pypa/twine/commit/b2832de88421edd0d11bfe2ceb53470e12f18bb2"><code>b2832de</code></a> Remove tests/fixtures/twine-1.5.0.zip</li>
<li><a href="https://github.com/pypa/twine/commit/970851d9b188dc916e6d95083b1797bd6c277ce5"><code>970851d</code></a> Remove tests/alt-fixtures/twine-1.5.0-py2.py3-none-any.whl</li>
<li><a href="https://github.com/pypa/twine/commit/2386ca5300cd7bde59432834d362c07de61e9a53"><code>2386ca5</code></a> build(deps): bump actions/upload-artifact from 4.4.3 to 4.5.0 (<a href="https://redirect.github.com/pypa/twine/issues/1205">#1205</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/pypa/twine/compare/6.0.1...6.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=twine&package-manager=pip&previous-version=6.0.1&new-version=6.1.0)](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..7fcde51 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,7 +42,7 @@ 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'",
   # Testing framework.
@@ -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"),
     [