| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Use the tool com2ann to automatically convert most type comments to type
annotations. Some type comments continue to exist where any work beyond
the automatic conversion was required (for example, additional
formatting or circular references).
For additional information on the com2ann tool, see:
https://github.com/ilevkivskyi/com2ann
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 f-strings for simple string formatting
|
| |
| |
| |
| |
| |
| |
| | |
Use pyupgrade to convert simple string formatting to use f-string
syntax. pyupgrade is intentionally timid and will not create an f-string
if it would make the expression longer or if the substitution parameters
are anything but simple names or dotted names.
|
|/
|
|
|
| |
Unnecessary since dropping Python 2 support. In Python 3, all classes
are new style classes.
|
| |
|
|
|
|
| |
Unnecessary since dropping Python 2.
|
|\
| |
| | |
Only do the ensure_text() dance on Windows
|
| |
| |
| |
| | |
POSIX is problematic when the environment is not configured properly.
|
|/ |
|
|
|
|
|
|
| |
Toward minimizing style changes in the overall PR diff, or toward
consistency with the future use of black (in cases where I wasn't sure
of a good way to minimize the diff).
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Similar to the InstallRequirement temp build dir, now we'll be able to
refactor this to be globally managed.
|
|
|
|
|
|
| |
Now we can refactor this to be globally managed, and it will have the
same behavior as it does currently (if there is any
PreviousBuildDirError it will not be cleaned up).
|
|
|
|
|
| |
Now we can opt-in to globally-managed + globally-configured file
deletion for pre-existing directories by passing an explicit `None`.
|
| |
|
|
|
|
|
|
| |
This gives us a global toggle that we can use to control whether
temporary directories get deleted from one place (ideally, in the
commands taking --no-clean).
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In cases where there is not a clear scope, or where enforcing a scope
and passing a temp directory to callees creates unnecessary coupling
between components, this will let us tie the lifetime of temporary
directories to the lifetime of the application without using e.g.
atexit or finalizers.
This has the benefit of being easier to test and reason about.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
conflicts (#6225)
|
| |
|
| |
|
| |
|
| |
|
|
|