Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix types for logging Rich objects #11136

Merged
merged 2 commits into from
May 31, 2022
Merged

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented May 22, 2022

Traceback (most recent call last):
  File "/Users/pradyunsg/Developer/github/pip/.venv/lib/python3.10/site-packages/pip/_internal/self_outdated_check.py", line 237, in pip_self_version_check
    logger.info("[present-rich] %s", upgrade_prompt)
  File "/Users/pradyunsg/.asdf/installs/python/3.10.1/lib/python3.10/logging/__init__.py", line 1468, in info
    self._log(INFO, msg, args, **kwargs)
  File "/Users/pradyunsg/.asdf/installs/python/3.10.1/lib/python3.10/logging/__init__.py", line 1615, in _log
    self.handle(record)
  File "/Users/pradyunsg/.asdf/installs/python/3.10.1/lib/python3.10/logging/__init__.py", line 1625, in handle
    self.callHandlers(record)
  File "/Users/pradyunsg/.asdf/installs/python/3.10.1/lib/python3.10/logging/__init__.py", line 1687, in callHandlers
    hdlr.handle(record)
  File "/Users/pradyunsg/.asdf/installs/python/3.10.1/lib/python3.10/logging/__init__.py", line 967, in handle
    self.emit(record)
  File "/Users/pradyunsg/Developer/github/pip/.venv/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 158, in emit
    assert isinstance(
AssertionError: UpgradePrompt(old='22.1', new='22.1.1') is not rich-console-renderable

Turns out, my attempt at defensive coding was overly defensive and the pretty upgrade prompts do not work in 21.1 or 21.1.1. :(

scottgigante-immunai added a commit to scottgigante-immunai/openproblems that referenced this pull request May 29, 2022
@pradyunsg pradyunsg marked this pull request as ready for review May 31, 2022 11:00
@pradyunsg pradyunsg merged commit 7be9b42 into pypa:main May 31, 2022
@pradyunsg pradyunsg deleted the fix-upgrade-prompt branch May 31, 2022 11:00
@pradyunsg pradyunsg added this to the 22.1 milestone May 31, 2022
pradyunsg added a commit to pradyunsg/pip that referenced this pull request May 31, 2022
inmantaci pushed a commit to inmanta/inmanta-core that referenced this pull request May 31, 2022
Bumps [pip](https://github.com/pypa/pip) from 22.1.1 to 22.1.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/pypa/pip/blob/main/NEWS.rst">pip's changelog</a>.</em></p>
<blockquote>
<h1>22.1.2 (2022-05-31)</h1>
<h2>Bug Fixes</h2>
<ul>
<li>Revert <code>[#10979](pypa/pip#10979) &lt;https://github.com/pypa/pip/issues/10979&gt;</code>_ since it introduced a regression in certain edge cases. (<code>[#10979](pypa/pip#10979) &lt;https://github.com/pypa/pip/issues/10979&gt;</code>_)</li>
<li>Fix an incorrect assertion in the logging logic, that prevented the upgrade prompt from being presented. (<code>[#11136](pypa/pip#11136) &lt;https://github.com/pypa/pip/issues/11136&gt;</code>_)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pypa/pip/commit/5f12c59f69656cf682cbd20cc1eee880578bce88"><code>5f12c59</code></a> Bump for release</li>
<li><a href="https://github.com/pypa/pip/commit/70c9b36582554e9a306429f1c29cca5c47d7d41c"><code>70c9b36</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/11134">#11134</a> from q0w/revert-10998-handle-netrc</li>
<li><a href="https://github.com/pypa/pip/commit/0799ceac4c69cd4787ffed48b0afcfae93afe3f1"><code>0799cea</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/11136">#11136</a> from pradyunsg/fix-upgrade-prompt</li>
<li>See full diff in <a href="https://github.com/pypa/pip/compare/22.1.1...22.1.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pip&package-manager=pip&previous-version=22.1.1&new-version=22.1.2)](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 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>
inmantaci pushed a commit to inmanta/inmanta-core that referenced this pull request Jun 1, 2022
Bumps [pip](https://github.com/pypa/pip) from 22.1.1 to 22.1.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/pypa/pip/blob/main/NEWS.rst">pip's changelog</a>.</em></p>
<blockquote>
<h1>22.1.2 (2022-05-31)</h1>
<h2>Bug Fixes</h2>
<ul>
<li>Revert <code>[#10979](pypa/pip#10979) &lt;https://github.com/pypa/pip/issues/10979&gt;</code>_ since it introduced a regression in certain edge cases. (<code>[#10979](pypa/pip#10979) &lt;https://github.com/pypa/pip/issues/10979&gt;</code>_)</li>
<li>Fix an incorrect assertion in the logging logic, that prevented the upgrade prompt from being presented. (<code>[#11136](pypa/pip#11136) &lt;https://github.com/pypa/pip/issues/11136&gt;</code>_)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pypa/pip/commit/5f12c59f69656cf682cbd20cc1eee880578bce88"><code>5f12c59</code></a> Bump for release</li>
<li><a href="https://github.com/pypa/pip/commit/70c9b36582554e9a306429f1c29cca5c47d7d41c"><code>70c9b36</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/11134">#11134</a> from q0w/revert-10998-handle-netrc</li>
<li><a href="https://github.com/pypa/pip/commit/0799ceac4c69cd4787ffed48b0afcfae93afe3f1"><code>0799cea</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/11136">#11136</a> from pradyunsg/fix-upgrade-prompt</li>
<li>See full diff in <a href="https://github.com/pypa/pip/compare/22.1.1...22.1.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pip&package-manager=pip&previous-version=22.1.1&new-version=22.1.2)](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 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>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant