| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Co-Authored-By: Tzu-ping Chung <uranusjr@gmail.com>
Co-Authored-By: Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com>
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
understand --home but instead requires the --install-dir option.
Parially fixes #4390
|
| |
| |
| |
| | |
Followup to c148bcc1aa4025a9dae5bcdabe1a1e01e6df28e5.
|
| |
| |
| |
| | |
Remove mypy exceptions that are straightforward to remove.
|
| | |
|
|\ \ |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since Python 3.6, subprocess supports decoding stdout and stderr. Like
before, decoding errors are handled using "backslashreplace".
One difference: In the event of a decoding error, pip previously logged
a warning before trying again with "backslashreplace". Subprocess does
not log such a warning.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With Python 2 dropped, only bytes need to be handled. Passing str was a
nop. These bytes/str boundaries are much clearer now.
There remains one use of str_to_display(): constole_to_str(). It
converts subprocess bytes output to str while handling decoding errors.
|
|\ \ \
| |/ /
|/| | |
|
| | | |
|
|\ \ \
| |_|/
|/| | |
Remove Python 2 compat shim path_to_display()
|
| | |
| | |
| | |
| | |
| | |
| | | |
Per the function's type signature, this accepted either a str or None.
In both cases, the value was returned unaltered. Since dropping Python
2, it has been unnecessary.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The typing module has been available since Python 3.5. Guarding the
import has been unnecessary since dropping Python 2.
Some guards remain to either:
- Avoid circular imports
- Importing objects that are also guarded by typing.TYPE_CHECKING
- Avoid mypy_extensions dependency
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Removes the vendored contextlib2.
ExitStack and suppress are available from stdlib contextlib on all
supported Python versions.
The nullcontext context manager which isn't available in Python 3.6, but
the function is simple to implement. Once Python 3.6 support is dropped,
so too can the compat shim.
|
| |
| |
| |
| |
| |
| |
| | |
All usages of it now use Environment.get_distribution() instead.
InstallRequirement.installed_version is also removed since it is no
longer used anywhere in the code base.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The stdlib module has been available since Python 3.5 and the
TYPE_CHECKING constant has been available since 3.5.2.
By using stdlib, this removes the need for pip to maintain its own
Python 2 typing compatibility shim.
|
|\ \
| | |
| | | |
Remove unnecessary uses of six.ensure_(binary|str|text)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Now that Python 2 is not supported, the bytes/str boundaries are more
clear and explicit. Using six.ensure_* methods for backwards
compatibility is no longer necessary as the types are known and verified
using mypy.
One exception is tests/lib/wheel.py which allows tests to pass test
setup data as either bytes or str.
The module operations.install.wheel also remains untouched as it is
especially delicate to bytes/str mixups and the current version is
working.
|
|\ \ \
| |_|/
|/| | |
Use keyword-only arguments
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
https://www.python.org/dev/peps/pep-3102/
Replaces the pattern: self.name = kwargs.pop('name')
Keyword-only arguments offer some advantages:
- In the event of a typo or misuse, a more informative error is
presented to the programmer.
- More self documenting and makes interfaces more explicit.
- They more easily allow explicit typing.
Adding types to ConfigOptionParser required changing some call sites to
pass arguments without using a dict due to mypy bug:
https://github.com/python/mypy/issues/9676
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
pkg_resources performs annoying caching that needs to be worked around
in some parts of pip. This makes it easier to represent the difference
between environments backend by WorkingSet() and working_set.
|
| | | |
|
|/ / |
|
|\ \
| | |
| | | |
Use Formatter.default_time_format after dropping PY2
|
| | | |
|
|\ \ \
| | | |
| | | | |
Revert #7969 and fix VCS stdout/stderr capture
|
| |\ \ \
| | | |/
| | |/| |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Use dict and set comprehension where available
|
| | |/ /
| |/| | |
|
| | | |
| | | |
| | | |
| | | | |
Unused since e706af20fe9e73cab3482b1f34b5510e88909506.
|
|\ \ \ \
| | | | |
| | | | | |
Remove unnecessary __ne__ definitions
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Unnecessary since dropping Python 2 support. In Python 3, `__ne__`
defaults to the opposite of of `__eq__`.
https://docs.python.org/3/reference/datamodel.html#object.__ne__
> For `__ne__()`, by default it delegates to `__eq__()` and inverts the
> result unless it is `NotImplemented`.
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
The upstream bug has been fixed and released in all supported Python
version: https://bugs.python.org/issue14768
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Remove outdated mypy workaround for colorama import
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
The object returned by NamedTemporaryFile delegates all functions calls
to the underlying file so can avoid the type override by relying on IO
methods.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The class was being used in a single place, passed to csv.reader().
However, per the docs, csv.reader() can handle a list of str objects.
https://docs.python.org/3/library/csv.html#csv.reader
> csvfile can be any object which supports the iterator protocol and
> returns a string each time its __next__() method is called — file
> objects and list objects are both suitable.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Use unified OSError and its subclasses
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since Python 3.3, the following classes have merged into OSError. They
remain as aliases for backward compatibility.
- EnvironmentError
- IOError
- WindowsError
https://docs.python.org/3/library/exceptions.html#OSError
Python 3 also has subclasses of OSError to help identify more specific
errors. For example, FileNotFoundError. This allows simplifying some
except blocks.
|
|/ /
| |
| |
| |
| |
| | |
Skip candidate not providing valid metadata
This reverts commit 7165ab8cb9a0d6297b5a0dcd7d9a84350d0a0b3b.
|
|\ \
| | |
| | | |
Replace io.open() and codecs.open() with builtin open()
|
| | |
| | |
| | |
| | |
| | | |
In Python 3, these are functionally equivalent and share the same
feature set.
|