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

Return a better error message if a file: URL is not found #10263

Merged
merged 37 commits into from
Oct 8, 2021

Conversation

DiddiLeija
Copy link
Member

Closes #10237. Print better error messages if the file/URL is not found.

news/10263.bugfix.rst Outdated Show resolved Hide resolved
@DiddiLeija
Copy link
Member Author

@uranusjr I requested a review from you, because you suggested this change. Tell me if I can do something else.

@pradyunsg
Copy link
Member

Got an example of before/after with this change?

@DiddiLeija
Copy link
Member Author

Well, as we were saying on #10237, using a bad file: specifier returns a weird error message:

AttributeError: 'FileNotFoundError' object has no attribute 'read'

This is because the file object (that must be usually returned) is set to the exception raised:

try:
stats = os.stat(pathname)
except OSError as exc:
resp.status_code = 404
resp.raw = exc
else:
modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
content_type = mimetypes.guess_type(pathname)[0] or "text/plain"
resp.headers = CaseInsensitiveDict(
{
"Content-Type": content_type,
"Content-Length": stats.st_size,
"Last-Modified": modified,
}
)
resp.raw = open(pathname, "rb")
resp.close = resp.raw.close

So, I am trying to set the resp.raw to a file object containing the exception to avoid that problem.

But, taking a closer look, I am not sure if the exception will be raised when set, or it will be taken as the requirements file, causing another kind of bug 🤔. Maybe we can directly raise (instead of returning a file object), or even catch the exception after returned to raise it on a "more confortable" way.

@uranusjr
Copy link
Member

uranusjr commented Aug 3, 2021

But, taking a closer look, I am not sure if the exception will be raised when set, or it will be taken as the requirements file

pip checks the response code of an HTTP request, and a 404 Not Found code will make it emit a nice response:

$ pip install https://pypi.org/project/12345/
Collecting https://pypi.org/project/12345/
  ERROR: HTTP error 404 while getting https://pypi.org/project/12345/
ERROR: Could not install requirement https://pypi.org/project/12345/ because of HTTP error 404 Client Error: Not Found for url: https://pypi.org/project/12345/ for URL https://pypi.org/project/12345/

I don’t know what the message would look like for a file: URL (because we could never reach that error due to this bug) but you can try it out and tweak the format to make sense.

@DiddiLeija
Copy link
Member Author

I don’t know what the message would look like for a file: URL (because we could never reach that error due to this bug) but you can try it out and tweak the format to make sense.

Ok, I'll try it.

@DiddiLeija
Copy link
Member Author

DiddiLeija commented Aug 5, 2021

I tried to run pip install -r file:requirements.txt under this branch and got this message:

ERROR: 404 Client Error: None for url: file:///requirements.txt

It seems like pip is interpreting the message as we want. The message sounds reasonable for me, but tell me if this sounds confusing for you.

@uranusjr
Copy link
Member

uranusjr commented Aug 5, 2021

I wonder where that None part came from and if we could replace to with FileNotFoundError (which should be pretty recognisable to any Python developer) or something similar.

@DiddiLeija
Copy link
Member Author

DiddiLeija commented Aug 5, 2021

I tried a simple code (similar to the real one) to test the current format for these errors and got this:

>>>import io, os
>>># build a try/except block that fails to see the message
>>>try:
...    f = os.stat("some_imaginary_file.txt")
...except OSError as exc:
...    error_message = f"{type(exc).__name__}: {str(exc)}"
...    raw = io.BytesIO(error_message.encode("utf8"))
...
>>>raw.read()
b"FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado: 'some_imaginary_file.txt'"

(I am using a mexican Windows computer with Python 3.8.2, but this example shows how the exception must look like).

On the above example, raw.read() (that represents resp.raw.read()) returns a reasonable exception for me. Considering this, I consider that this exception:

ERROR: 404 Client Error: None for url: file:///requirements.txt

could be derived from the exception we are fixing, because it looks really different. I think requests is doing something else with resp.raw on this specific case.

@uranusjr
Copy link
Member

uranusjr commented Aug 5, 2021

could be derived from the exception we are fixing, because it looks really different. I think requests is doing something else with resp.raw on this specific case.

It makes sense, because Response.raw would contain the page content, which is usually a bunch of unintelligible HTML code. We’ll probably need to dig into requests to find out where and how that exception message is formatted.

@uranusjr
Copy link
Member

uranusjr commented Aug 5, 2021

Oh actually it’s our own code (not requests), and it’s Response.reason. So we should set that.

def raise_for_status(resp: Response) -> None:
http_error_msg = ""
if isinstance(resp.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings.
try:
reason = resp.reason.decode("utf-8")
except UnicodeDecodeError:
reason = resp.reason.decode("iso-8859-1")
else:
reason = resp.reason
if 400 <= resp.status_code < 500:
http_error_msg = (
f"{resp.status_code} Client Error: {reason} for url: {resp.url}"
)
elif 500 <= resp.status_code < 600:
http_error_msg = (
f"{resp.status_code} Server Error: {reason} for url: {resp.url}"
)
if http_error_msg:
raise NetworkConnectionError(http_error_msg, response=resp)

@DiddiLeija
Copy link
Member Author

DiddiLeija commented Aug 5, 2021

@DiddiLeija
Copy link
Member Author

With the newest changes, the message looks like this on my computer:

ERROR: 404 Client Error: "FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado: 'file:////requirements.txt'" for url: file:///requirements.txt

Is this message reasonable for you? Or we must do something else?

@DiddiLeija
Copy link
Member Author

So, what do you think about this pull request?

@DiddiLeija DiddiLeija changed the title Return a better error message if a file is not found Return a better error message if a file: URL is not found Aug 12, 2021
@xavfernandez
Copy link
Member

Any chance to have a test for that ? :)

@DiddiLeija
Copy link
Member Author

I can create a test, if you want.

@DiddiLeija
Copy link
Member Author

Hmm... something went wrong. I will re-trigger the builds, to see what happens.

@DiddiLeija
Copy link
Member Author

I'm a bit confused by the pre-commit error message:

Check builtin type constructor use.......................................Failed
- hook id: check-builtin-literals
- exit code: 1

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repob0bwwgn2/py_env-python3.9/bin/check-builtin-literals", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.cache/pre-commit/repob0bwwgn2/py_env-python3.9/lib/python3.9/site-packages/pre_commit_hooks/check_builtin_literals.py", line 90, in main
    calls = check_file(
  File "/home/runner/.cache/pre-commit/repob0bwwgn2/py_env-python3.9/lib/python3.9/site-packages/pre_commit_hooks/check_builtin_literals.py", line 63, in check_file
    tree = ast.parse(f.read(), filename=filename)
  File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
  File "tests/functional/test_bad_url.py", line 25
    def test_filenotfound_error_message() -> None:
    ^
SyntaxError: invalid syntax
Debug Statements (Python)................................................Failed
- hook id: debug-statements
- exit code: 1

tests/functional/test_bad_url.py - Could not parse ast

	Traceback (most recent call last):
	  File "/home/runner/.cache/pre-commit/repob0bwwgn2/py_env-python3.9/lib/python3.9/site-packages/pre_commit_hooks/debug_statement_hook.py", line 55, in check_file
	    ast_obj = ast.parse(f.read(), filename=filename)
	  File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/ast.py", line 50, in parse
	    return compile(source, filename, mode, flags,
	  File "tests/functional/test_bad_url.py", line 25
	    def test_filenotfound_error_message() -> None:
	    ^
	SyntaxError: invalid syntax
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/functional/test_bad_url.py:1:1: E902 TokenError: EOF in multi-line statement

Any ideas to fix this?

@pfmoore
Copy link
Member

pfmoore commented Aug 16, 2021

return base + "".join(random.choice(alphabet) for _ in range(10) is missing a trailing parenthesis.

@DiddiLeija
Copy link
Member Author

Now, I only have this problem with flake8:

tests/functional/test_bad_url.py:30:43: E228 missing whitespace around modulo operator

I looked around the flake8 docs, and then to the pycodestyle docs, but I didn't find information to fix this.

@pfmoore
Copy link
Member

pfmoore commented Aug 16, 2021

That line is command = ["pip", "install", "file:%s"%file]. The error is "missing whitespace around modulo operator". The modulo operator is the %, so I'd assume it wants command = ["pip", "install", "file:%s" % file]. Also, why are you using %-formatting rather than format() or f-strings?

Are you able to run the lint commands locally? It would be better to fix the various lint errors before updating the PR, as it's a lot more costly triggering a new CI run for every typo 🙁

DiddiLeija and others added 9 commits October 2, 2021 16:21
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Use a more accurate test.
Modify the test catching.
Change the line length.
Remove a failing method.
Modify the tests.
Reduce the string sizes.
Add some indentations to the string formatting.
Adjust the expected error message.
@uranusjr uranusjr added this to the 21.3 milestone Oct 2, 2021
@pradyunsg
Copy link
Member

@uranusjr You added this to the 21.3 milestone. Do you think this is a release blocker, or is that more an indicator of when you'd like this to be done by?

@uranusjr
Copy link
Member

uranusjr commented Oct 6, 2021

Not a release blocker, I just thought we'd want to review this and include it if it's ready.

news/10263.bugfix.rst Outdated Show resolved Hide resolved
@pradyunsg
Copy link
Member

Whomever merges this, please squash merge this one.

news/10263.bugfix.rst Outdated Show resolved Hide resolved
@DiddiLeija
Copy link
Member Author

DiddiLeija commented Oct 8, 2021

Thanks @pradyunsg! I was sleeping when you pushed the changes (I woke up late today...), so thanks for doing it! :)

@pradyunsg pradyunsg merged commit 02b4f86 into pypa:main Oct 8, 2021
@DiddiLeija
Copy link
Member Author

Thanks @pradyunsg! :D

@DiddiLeija DiddiLeija deleted the filenotfound-error-message branch October 8, 2021 13:26
notatallshaw added a commit to notatallshaw/pip that referenced this pull request Oct 9, 2021
…c1adaedb8c3cc0

parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754892 -0400

# This is a combination of 13 commits.
# This is the 1st commit message:

Return a better error message if a `file:` URL is not found (pypa#10263)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
# This is the commit message #2:

Prefer failure causes when backtracking

# This is the commit message #3:

This fix is in the wrong PR confusing matters

# This is the commit message pypa#4:

Change name to backtrack_causes
Create is_backtrack_cause function

# This is the commit message pypa#5:

Fix newlines

# This is the commit message pypa#6:

Typo Fix in Comment

# This is the commit message pypa#7:

Fix lint errors

# This is the commit message pypa#8:

Add News Item

# This is the commit message pypa#9:

Newline

# This is the commit message pypa#10:

Better news.

# This is the commit message pypa#11:

Fix known depths

# This is the commit message pypa#12:

Fix known depths

# This is the commit message pypa#13:

Fix known depths

# This is the commit message pypa#14:

This fix is in the wrong PR confusing matters
notatallshaw added a commit to notatallshaw/pip that referenced this pull request Oct 9, 2021
parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754928 -0400

# This is a combination of 14 commits.tree 962cf1d58cffa4bd5102aa4cc6c1adaedb8c3cc0
parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754892 -0400

# This is a combination of 13 commits.
# This is the 1st commit message:

Return a better error message if a `file:` URL is not found (pypa#10263)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
# This is the commit message #2:

Prefer failure causes when backtracking

# This is the commit message #3:

This fix is in the wrong PR confusing matters

# This is the commit message pypa#4:

Change name to backtrack_causes
Create is_backtrack_cause function

# This is the commit message pypa#5:

Fix newlines

# This is the commit message pypa#6:

Typo Fix in Comment

# This is the commit message pypa#7:

Fix lint errors

# This is the commit message pypa#8:

Add News Item

# This is the commit message pypa#9:

Newline

# This is the commit message pypa#10:

Better news.

# This is the commit message pypa#11:

Fix known depths

# This is the commit message pypa#12:

Fix known depths

# This is the commit message pypa#13:

Fix known depths

# This is the commit message pypa#14:

This fix is in the wrong PR confusing matters

# This is the commit message pypa#16:

Change name to backtrack_causes
Create is_backtrack_cause function

# This is the commit message pypa#18:

Fix newlines

# This is the commit message pypa#19:

Typo Fix in Comment
notatallshaw added a commit to notatallshaw/pip that referenced this pull request Oct 9, 2021
parent af71f3c
author Damian <damian.peter.shaw@gmail.com> 1633755088 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633755088 -0400

parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754928 -0400

parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754892 -0400

Return a better error message if a `file:` URL is not found (pypa#10263)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>

Prefer failure causes when backtracking

This fix is in the wrong PR confusing matters

Change name to backtrack_causes
Create is_backtrack_cause function

Fix newlines

Typo Fix in Comment

Fix lint errors

Add News Item

Newline

Better news.

Fix known depths

Fix known depths

Fix known depths

This fix is in the wrong PR confusing matters

Change name to backtrack_causes
Create is_backtrack_cause function

Fix newlines

Typo Fix in Comment

Fix lint errors

# This is the commit message pypa#22:

Better news.

# This is the commit message pypa#23:

Update news/10479.feature.rst

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
notatallshaw added a commit to notatallshaw/pip that referenced this pull request Oct 9, 2021
author Damian <damian.peter.shaw@gmail.com> 1633755088 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633755088 -0400

parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754928 -0400

parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754892 -0400

Return a better error message if a `file:` URL is not found (pypa#10263)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>

Prefer failure causes when backtracking

This fix is in the wrong PR confusing matters

Change name to backtrack_causes
Create is_backtrack_cause function

Fix newlines

Typo Fix in Comment

Fix lint errors

Add News Item

Newline

Better news.

Fix known depths

Fix known depths

Fix known depths

This fix is in the wrong PR confusing matters

Change name to backtrack_causes
Create is_backtrack_cause function

Fix newlines

Typo Fix in Comment

Fix lint errors

Better news.

Update news/10479.feature.rst

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>

Fix mistake from merge
parent af71f3c
author Damian <damian.peter.shaw@gmail.com> 1633755088 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633755088 -0400

parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754928 -0400

parent 02b4f86
author Damian <damian.peter.shaw@gmail.com> 1633754869 -0400
committer Damian <damian.peter.shaw@gmail.com> 1633754892 -0400

Return a better error message if a `file:` URL is not found (pypa#10263)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>

Prefer failure causes when backtracking

This fix is in the wrong PR confusing matters

Change name to backtrack_causes
Create is_backtrack_cause function

Fix newlines

Typo Fix in Comment

Fix lint errors

Add News Item

Newline

Better news.

Fix known depths

Fix known depths

Fix known depths

This fix is in the wrong PR confusing matters

Change name to backtrack_causes
Create is_backtrack_cause function

Fix newlines

Typo Fix in Comment

Fix lint errors

Better news.

Update news/10479.feature.rst

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>

Fix mistake from merge
inmantaci pushed a commit to inmanta/inmanta-core that referenced this pull request Oct 12, 2021
Bumps [pip](https://github.com/pypa/pip) from 21.2.4 to 21.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.3 (2021-10-11)</h1>
<h2>Deprecations and Removals</h2>
<ul>
<li>Improve deprecation warning regarding the copying of source trees when installing from a local directory. (<code>[#10128](pypa/pip#10128) &lt;https://github.com/pypa/pip/issues/10128&gt;</code>_)</li>
<li>Suppress location mismatch warnings when pip is invoked from a Python source
tree, so <code>ensurepip</code> does not emit warnings on CPython <code>make install</code>. (<code>[#10270](pypa/pip#10270) &lt;https://github.com/pypa/pip/issues/10270&gt;</code>_)</li>
<li>On Python 3.10 or later, the installation scheme backend has been changed to use
<code>sysconfig</code>. This is to anticipate the deprecation of <code>distutils</code> in Python
3.10, and its scheduled removal in 3.12. For compatibility considerations, pip
installations running on Python 3.9 or lower will continue to use <code>distutils</code>. (<code>[#10358](pypa/pip#10358) &lt;https://github.com/pypa/pip/issues/10358&gt;</code>_)</li>
<li>Remove the <code>--build-dir</code> option and aliases, one last time. (<code>[#10485](pypa/pip#10485) &lt;https://github.com/pypa/pip/issues/10485&gt;</code>_)</li>
<li>In-tree builds are now the default. <code>--use-feature=in-tree-build</code> is now
ignored. <code>--use-deprecated=out-of-tree-build</code> may be used temporarily to ease
the transition. (<code>[#10495](pypa/pip#10495) &lt;https://github.com/pypa/pip/issues/10495&gt;</code>_)</li>
<li>Un-deprecate source distribution re-installation behaviour. (<code>[#8711](pypa/pip#8711) &lt;https://github.com/pypa/pip/issues/8711&gt;</code>_)</li>
</ul>
<h2>Features</h2>
<ul>
<li>Replace vendored appdirs with platformdirs. (<code>[#10202](pypa/pip#10202) &lt;https://github.com/pypa/pip/issues/10202&gt;</code>_)</li>
<li>Support <code>PEP 610 &lt;https://www.python.org/dev/peps/pep-0610/&gt;</code>_ to detect
editable installs in <code>pip freeze</code> and  <code>pip list</code>. The <code>pip list</code> column output
has a new <code>Editable project location</code> column, and the JSON output has a new
<code>editable_project_location</code> field. (<code>[#10249](pypa/pip#10249) &lt;https://github.com/pypa/pip/issues/10249&gt;</code>_)</li>
<li><code>pip freeze</code> will now always fallback to reporting the editable project
location when it encounters a VCS error while analyzing an editable
requirement. Before, it sometimes reported the requirement as non-editable. (<code>[#10410](pypa/pip#10410) &lt;https://github.com/pypa/pip/issues/10410&gt;</code>_)</li>
<li><code>pip show</code> now sorts <code>Requires</code> and <code>Required-By</code> alphabetically. (<code>[#10422](pypa/pip#10422) &lt;https://github.com/pypa/pip/issues/10422&gt;</code>_)</li>
<li>Do not raise error when there are no files to remove with <code>pip cache purge/remove</code>.
Instead log a warning and continue (to log that we removed 0 files). (<code>[#10459](pypa/pip#10459) &lt;https://github.com/pypa/pip/issues/10459&gt;</code>_)</li>
<li>When backtracking during dependency resolution, prefer the dependencies which are involved in the most recent conflict. This can significantly reduce the amount of backtracking required. (<code>[#10479](pypa/pip#10479) &lt;https://github.com/pypa/pip/issues/10479&gt;</code>_)</li>
<li>Cache requirement objects, to improve performance reducing reparses of requirement strings. (<code>[#10550](pypa/pip#10550) &lt;https://github.com/pypa/pip/issues/10550&gt;</code>_)</li>
<li>Support editable installs for projects that have a <code>pyproject.toml</code> and use a
build backend that supports :pep:<code>660</code>. (<code>[#8212](pypa/pip#8212) &lt;https://github.com/pypa/pip/issues/8212&gt;</code>_)</li>
<li>When a revision is specified in a Git URL, use git's partial clone feature to speed up source retrieval. (<code>[#9086](pypa/pip#9086) &lt;https://github.com/pypa/pip/issues/9086&gt;</code>_)</li>
<li>Add a <code>--debug</code> flag, to enable a mode that doesn't log errors and propagates them to the top level instead. This is primarily to aid with debugging pip's crashes. (<code>[#9349](pypa/pip#9349) &lt;https://github.com/pypa/pip/issues/9349&gt;</code>_)</li>
<li>If a host is explicitly specified as trusted by the user (via the --trusted-host option), cache HTTP responses from it in addition to HTTPS ones. (<code>[#9498](pypa/pip#9498) &lt;https://github.com/pypa/pip/issues/9498&gt;</code>_)</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li>Present a better error message, when a <code>file:</code> URL is not found. (<code>[#10263](pypa/pip#10263) &lt;https://github.com/pypa/pip/issues/10263&gt;</code>_)</li>
<li>Fix the auth credential cache to allow for the case in which
the index url contains the username, but the password comes
from an external source, such as keyring. (<code>[#10269](pypa/pip#10269) &lt;https://github.com/pypa/pip/issues/10269&gt;</code>_)</li>
<li>Fix double unescape of HTML <code>data-requires-python</code> and <code>data-yanked</code> attributes. (<code>[#10378](pypa/pip#10378) &lt;https://github.com/pypa/pip/issues/10378&gt;</code>_)</li>
<li>New resolver: Fixes depth ordering of packages during resolution, e.g. a dependency 2 levels deep will be ordered before a dependecy 3 levels deep. (<code>[#10482](pypa/pip#10482) &lt;https://github.com/pypa/pip/issues/10482&gt;</code>_)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pypa/pip/commit/abec8a701bfa66aa15fedf4c898011aa2d95f29e"><code>abec8a7</code></a> Bump for release</li>
<li><a href="https://github.com/pypa/pip/commit/68a70486c9224f9d25be3cbf56c73d8a33c6a713"><code>68a7048</code></a> Update AUTHORS.txt</li>
<li><a href="https://github.com/pypa/pip/commit/9f18a403ca41f4e42fbb89d286b6571a099cb54b"><code>9f18a40</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/10481">#10481</a> from notatallshaw/prefer_failures</li>
<li><a href="https://github.com/pypa/pip/commit/db496cbce518fa159476695db0cd4f1c1a8ab6f5"><code>db496cb</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/10563">#10563</a> from pradyunsg/shorter-timeout</li>
<li><a href="https://github.com/pypa/pip/commit/4fac2b90a5d200b46e7b576013bb25f4ebb3f937"><code>4fac2b9</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/10550">#10550</a> from jbylund/joe/cache_requirement_creation</li>
<li><a href="https://github.com/pypa/pip/commit/786957cf85a641d49b4cfcceef717ef229ac8238"><code>786957c</code></a> Use a shorter timeout, to ensure that this fails more often</li>
<li><a href="https://github.com/pypa/pip/commit/1e3c127d4a938643aca1bbc25e6581493e316476"><code>1e3c127</code></a> Avoid passing <code>.</code> to vendoring</li>
<li><a href="https://github.com/pypa/pip/commit/610424f9f8ad1f99d0a48bf9a53e7a9df4242304"><code>610424f</code></a> Quote &quot;PreferenceInformation&quot; to avoid runtime NameError</li>
<li><a href="https://github.com/pypa/pip/commit/c01b5c6d8a4858cf733408b4b020933f902dda9e"><code>c01b5c6</code></a> Update a test for resolvelib 0.8.0</li>
<li><a href="https://github.com/pypa/pip/commit/394a24eb1a5f9af5da7d4d2452ed5fe952de5db2"><code>394a24e</code></a> Upgrade resolvelib to 0.8.0</li>
<li>Additional commits viewable in <a href="https://github.com/pypa/pip/compare/21.2.4...21.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.2.4&new-version=21.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>
mergify bot pushed a commit to andrewbolster/bolster that referenced this pull request Oct 12, 2021
Bumps [pip](https://github.com/pypa/pip) from 21.2.4 to 21.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.3 (2021-10-11)</h1>
<h2>Deprecations and Removals</h2>
<ul>
<li>Improve deprecation warning regarding the copying of source trees when installing from a local directory. (<code>[#10128](pypa/pip#10128) &lt;https://github.com/pypa/pip/issues/10128&gt;</code>_)</li>
<li>Suppress location mismatch warnings when pip is invoked from a Python source
tree, so <code>ensurepip</code> does not emit warnings on CPython <code>make install</code>. (<code>[#10270](pypa/pip#10270) &lt;https://github.com/pypa/pip/issues/10270&gt;</code>_)</li>
<li>On Python 3.10 or later, the installation scheme backend has been changed to use
<code>sysconfig</code>. This is to anticipate the deprecation of <code>distutils</code> in Python
3.10, and its scheduled removal in 3.12. For compatibility considerations, pip
installations running on Python 3.9 or lower will continue to use <code>distutils</code>. (<code>[#10358](pypa/pip#10358) &lt;https://github.com/pypa/pip/issues/10358&gt;</code>_)</li>
<li>Remove the <code>--build-dir</code> option and aliases, one last time. (<code>[#10485](pypa/pip#10485) &lt;https://github.com/pypa/pip/issues/10485&gt;</code>_)</li>
<li>In-tree builds are now the default. <code>--use-feature=in-tree-build</code> is now
ignored. <code>--use-deprecated=out-of-tree-build</code> may be used temporarily to ease
the transition. (<code>[#10495](pypa/pip#10495) &lt;https://github.com/pypa/pip/issues/10495&gt;</code>_)</li>
<li>Un-deprecate source distribution re-installation behaviour. (<code>[#8711](pypa/pip#8711) &lt;https://github.com/pypa/pip/issues/8711&gt;</code>_)</li>
</ul>
<h2>Features</h2>
<ul>
<li>Replace vendored appdirs with platformdirs. (<code>[#10202](pypa/pip#10202) &lt;https://github.com/pypa/pip/issues/10202&gt;</code>_)</li>
<li>Support <code>PEP 610 &lt;https://www.python.org/dev/peps/pep-0610/&gt;</code>_ to detect
editable installs in <code>pip freeze</code> and  <code>pip list</code>. The <code>pip list</code> column output
has a new <code>Editable project location</code> column, and the JSON output has a new
<code>editable_project_location</code> field. (<code>[#10249](pypa/pip#10249) &lt;https://github.com/pypa/pip/issues/10249&gt;</code>_)</li>
<li><code>pip freeze</code> will now always fallback to reporting the editable project
location when it encounters a VCS error while analyzing an editable
requirement. Before, it sometimes reported the requirement as non-editable. (<code>[#10410](pypa/pip#10410) &lt;https://github.com/pypa/pip/issues/10410&gt;</code>_)</li>
<li><code>pip show</code> now sorts <code>Requires</code> and <code>Required-By</code> alphabetically. (<code>[#10422](pypa/pip#10422) &lt;https://github.com/pypa/pip/issues/10422&gt;</code>_)</li>
<li>Do not raise error when there are no files to remove with <code>pip cache purge/remove</code>.
Instead log a warning and continue (to log that we removed 0 files). (<code>[#10459](pypa/pip#10459) &lt;https://github.com/pypa/pip/issues/10459&gt;</code>_)</li>
<li>When backtracking during dependency resolution, prefer the dependencies which are involved in the most recent conflict. This can significantly reduce the amount of backtracking required. (<code>[#10479](pypa/pip#10479) &lt;https://github.com/pypa/pip/issues/10479&gt;</code>_)</li>
<li>Cache requirement objects, to improve performance reducing reparses of requirement strings. (<code>[#10550](pypa/pip#10550) &lt;https://github.com/pypa/pip/issues/10550&gt;</code>_)</li>
<li>Support editable installs for projects that have a <code>pyproject.toml</code> and use a
build backend that supports :pep:<code>660</code>. (<code>[#8212](pypa/pip#8212) &lt;https://github.com/pypa/pip/issues/8212&gt;</code>_)</li>
<li>When a revision is specified in a Git URL, use git's partial clone feature to speed up source retrieval. (<code>[#9086](pypa/pip#9086) &lt;https://github.com/pypa/pip/issues/9086&gt;</code>_)</li>
<li>Add a <code>--debug</code> flag, to enable a mode that doesn't log errors and propagates them to the top level instead. This is primarily to aid with debugging pip's crashes. (<code>[#9349](pypa/pip#9349) &lt;https://github.com/pypa/pip/issues/9349&gt;</code>_)</li>
<li>If a host is explicitly specified as trusted by the user (via the --trusted-host option), cache HTTP responses from it in addition to HTTPS ones. (<code>[#9498](pypa/pip#9498) &lt;https://github.com/pypa/pip/issues/9498&gt;</code>_)</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li>Present a better error message, when a <code>file:</code> URL is not found. (<code>[#10263](pypa/pip#10263) &lt;https://github.com/pypa/pip/issues/10263&gt;</code>_)</li>
<li>Fix the auth credential cache to allow for the case in which
the index url contains the username, but the password comes
from an external source, such as keyring. (<code>[#10269](pypa/pip#10269) &lt;https://github.com/pypa/pip/issues/10269&gt;</code>_)</li>
<li>Fix double unescape of HTML <code>data-requires-python</code> and <code>data-yanked</code> attributes. (<code>[#10378](pypa/pip#10378) &lt;https://github.com/pypa/pip/issues/10378&gt;</code>_)</li>
<li>New resolver: Fixes depth ordering of packages during resolution, e.g. a dependency 2 levels deep will be ordered before a dependecy 3 levels deep. (<code>[#10482](pypa/pip#10482) &lt;https://github.com/pypa/pip/issues/10482&gt;</code>_)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/pypa/pip/commit/abec8a701bfa66aa15fedf4c898011aa2d95f29e"><code>abec8a7</code></a> Bump for release</li>
<li><a href="https://github.com/pypa/pip/commit/68a70486c9224f9d25be3cbf56c73d8a33c6a713"><code>68a7048</code></a> Update AUTHORS.txt</li>
<li><a href="https://github.com/pypa/pip/commit/9f18a403ca41f4e42fbb89d286b6571a099cb54b"><code>9f18a40</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/10481">#10481</a> from notatallshaw/prefer_failures</li>
<li><a href="https://github.com/pypa/pip/commit/db496cbce518fa159476695db0cd4f1c1a8ab6f5"><code>db496cb</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/10563">#10563</a> from pradyunsg/shorter-timeout</li>
<li><a href="https://github.com/pypa/pip/commit/4fac2b90a5d200b46e7b576013bb25f4ebb3f937"><code>4fac2b9</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/pip/issues/10550">#10550</a> from jbylund/joe/cache_requirement_creation</li>
<li><a href="https://github.com/pypa/pip/commit/786957cf85a641d49b4cfcceef717ef229ac8238"><code>786957c</code></a> Use a shorter timeout, to ensure that this fails more often</li>
<li><a href="https://github.com/pypa/pip/commit/1e3c127d4a938643aca1bbc25e6581493e316476"><code>1e3c127</code></a> Avoid passing <code>.</code> to vendoring</li>
<li><a href="https://github.com/pypa/pip/commit/610424f9f8ad1f99d0a48bf9a53e7a9df4242304"><code>610424f</code></a> Quote &quot;PreferenceInformation&quot; to avoid runtime NameError</li>
<li><a href="https://github.com/pypa/pip/commit/c01b5c6d8a4858cf733408b4b020933f902dda9e"><code>c01b5c6</code></a> Update a test for resolvelib 0.8.0</li>
<li><a href="https://github.com/pypa/pip/commit/394a24eb1a5f9af5da7d4d2452ed5fe952de5db2"><code>394a24e</code></a> Upgrade resolvelib to 0.8.0</li>
<li>Additional commits viewable in <a href="https://github.com/pypa/pip/compare/21.2.4...21.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.2.4&new-version=21.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>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2021
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.

'file:' identifier in '--requirements' argument yields FileNotFoundError
5 participants