-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Vendoring of tenacity
is leaky
#10020
Comments
Thanks for raising the issue. I think an easy way would be to vendor a patch to delete those imports. We already have a few of those here. Would you be interested in contributing one for this? |
Code depending on this conditional import could break if an old version of Tornado is present in the environment, rendering pip unusable. Fixes pypa#10020
Sure: #10029 |
@sbidoul do you think this is important enough for a bugfix release? 😅 |
Is this a new problem that was introduced in 21.1, or has it been around for a while and just not been noticed before? If it's not a new problem, I doubt it's worth a bugfix release (although it's the RM's call). If it is a new issue, I'm still ambivalent - it seems pretty rare in practice 🤷 |
It appears to be new in 21.1 (introduced in 64ecfc8). It is indeed rare (it requires using a version of Tornado from before Feb 2015), but it has happened and when it happens it breaks things in a way that you can't really recover from without blowing away the virtualenv. (but overall I'm ambivalent too - personally I'd probably wait for a second occurrence before starting a release). |
Ah yes, I'd forgotten we'd switched libraries. But equally, it's worth remembering that 21.2 isn't that far off (July) so we're not talking about a huge delay either way. |
Well, if someone else hits this, it'd probably make sense to expidite this. Otherwise, we'll leave it be until the next release. |
Code depending on this conditional import could break if an old version of Tornado is present in the environment, rendering pip unusable. Fixes pypa#10020
Code depending on this conditional import could break if an old version of Tornado is present in the environment, rendering pip unusable. Fixes pypa#10020
FYI we've had a second commenter on tornadoweb/tornado#3034 so it does look like this is affecting more than one person. |
Heyo @bdarnell! Gentle nudge to not mention the issue link/number in the commit message. That results in a lot of spam in this issue, as people rebase that PR or cherry pick changes or just do anything with that commit on GitHub. |
Ah, OK, I can remove that if I have to update the commit again. I'm well aware of the spam that can come from an |
I just solve,If you want to solve this problem quickly,pull down the git source code for Tornado>=4.0 and above and install it with the command: |
Bumps [pip](https://github.com/pypa/pip) from 21.1.2 to 21.1.3. <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>21.1.3 (2021-06-26)</h1> <h2>Bug Fixes</h2> <ul> <li>Remove unused optional <code>tornado</code> import in vendored <code>tenacity</code> to prevent old versions of Tornado from breaking pip. (<code>[#10020](pypa/pip#10020) <https://github.com/pypa/pip/issues/10020></code>_)</li> <li>Require <code>setup.cfg</code>-only projects to be built via PEP 517, by requiring an explicit dependency on setuptools declared in pyproject.toml. (<code>[#10031](pypa/pip#10031) <https://github.com/pypa/pip/issues/10031></code>_)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pypa/pip/commit/e69a8f3987f44178dec8b9137158b4a6ed778ca3"><code>e69a8f3</code></a> Bump for release</li> <li><a href="https://github.com/pypa/pip/commit/c141edc5c90d0e3c2f40635516f151e2d02b5d95"><code>c141edc</code></a> remove support for setup.cfg only projects</li> <li><a href="https://github.com/pypa/pip/commit/363e90b62c3bfff14a4684545d54300007bb4d78"><code>363e90b</code></a> Avoid importing a non-vendored version of Tornado</li> <li><a href="https://github.com/pypa/pip/commit/4cab55f48ef2d05da40dd603910a68f81523ddd4"><code>4cab55f</code></a> Rephrase the warning printed when run as root on Unix</li> <li>See full diff in <a href="https://github.com/pypa/pip/compare/21.1.2...21.1.3">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=21.1.2&new-version=21.1.3)](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>
Description
Tenacity contains a conditional import of tornado. This makes the behavior of
pip
sensitive to third-party packages outside of its vendor directory. Specifically, if a version of tornado that does not include thetornado.gen.sleep
function is installed,pip
will fail to start. (This is unlikely since this function has been around a long time and we have no plans of deprecating it or removing it. But we do have a report of this happening in tornadoweb/tornado#3034)Expected behavior
Pip should not be affected by the presence or absence of any other third-party packages. Any conditional imports in its vendored dependencies should be modified to unconditionally fail (e.g. replace the above-linked block with
tornado = None
).pip version
21.1.2
Python version
3.8
OS
linux
How to Reproduce
pip install tornado==4.0.0
pip --version
Output
The text was updated successfully, but these errors were encountered: