summaryrefslogtreecommitdiff
path: root/src/pip/_internal/utils/temp_dir.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace Iterator[T] with Generator[T,None, None] (#11007)q0w2022-04-091-4/+4
| | | Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
* Move many type comments to annotationsJon Dufresne2021-08-101-35/+21
| | | | | | | | | | 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
* Blacken src/pip/_internal/utils directoryJon Dufresne2021-02-211-22/+16
|
* Remove typing.TYPE_CHECKING guardsJon Dufresne2021-02-191-7/+3
| | | | | | | | | | | 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
* Prefer stdlib contextlib over contextlib2 when availableJon Dufresne2021-02-191-3/+1
| | | | | | | | | | | 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.
* Replace pip._internal.utils.typing with stdlib typingJon Dufresne2021-02-181-2/+2
| | | | | | | | 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)Jon Dufresne2020-12-271-11/+1
| | | | | | | | | | | | | | 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.
* Merge pull request #9361 from jdufresne/f-stringsPradyun Gedam2020-12-261-4/+4
|\ | | | | Use f-strings for simple string formatting
| * Use f-strings for simple string formattingJon Dufresne2020-12-251-4/+4
| | | | | | | | | | | | | | 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.
* | Remove object from class definitionsJon Dufresne2020-12-251-3/+3
|/ | | | | Unnecessary since dropping Python 2 support. In Python 3, all classes are new style classes.
* Use short Python3 super() syntaxJon Dufresne2020-12-241-2/+2
|
* Remove __future__ importsJon Dufresne2020-12-241-2/+0
| | | | Unnecessary since dropping Python 2.
* Merge pull request #8666 from uranusjr/rmtree-unicode-use-file-system-encodingPradyun Gedam2020-10-271-3/+11
|\ | | | | Only do the ensure_text() dance on Windows
| * Only do the ensure_text() dance on WindowsTzu-ping Chung2020-10-271-3/+11
| | | | | | | | POSIX is problematic when the environment is not configured properly.
* | Remove --build-dir option, as per deprecationPaul Moore2020-10-271-0/+2
|/
* Clean up code style changesPradyun Gedam2020-07-171-2/+4
| | | | | | 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).
* Enable flake8-logging-formatNguyễn Gia Phong2020-07-171-6/+4
|
* Non-ASCII names are not weirdTzu-ping Chung2020-05-191-2/+2
|
* Python 2 works but not testedTzu-ping Chung2020-05-191-1/+4
|
* Make ephem-wheel-cache tempdir name globally accessibleChris Hunt2020-02-041-0/+1
|
* Add BuildEnvironment._temp_dir to tempdir registryChris Hunt2020-02-041-1/+2
| | | | | Similar to the InstallRequirement temp build dir, now we'll be able to refactor this to be globally managed.
* Add InstallRequirement._temp_build_dir to tempdir registryChris Hunt2020-02-041-1/+8
| | | | | | 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).
* Use explicit default value for TempDirectory delete flagChris Hunt2020-01-291-6/+18
| | | | | Now we can opt-in to globally-managed + globally-configured file deletion for pre-existing directories by passing an explicit `None`.
* Delay TempDirectory.delete resolution to cleanupTzu-ping Chung2020-01-171-8/+12
|
* Manage temp directory deletion centrallyChris Hunt2020-01-101-2/+46
| | | | | | 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).
* remove disallow_untyped_defs=False for more modulesMaxim Kurnikov2019-12-131-4/+11
|
* Add global TempDirectory managerChris Hunt2019-12-091-2/+25
| | | | | | | | | | 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.
* add per-file disallow_untyped_defs=False, and set it to True globallyMaxim Kurnikov2019-09-291-0/+3
|
* Assert TempDirectory.path has not been cleaned up on accessChris Hunt2019-09-231-2/+7
|
* Switch TempDirectory.path to propertyChris Hunt2019-09-231-1/+6
|
* Add types to TempDirectoryChris Hunt2019-09-221-1/+11
|
* Unconditionally create TempDirectory.pathChris Hunt2019-09-221-24/+13
|
* Make TempDirectory._create return path instead of setting self.pathChris Hunt2019-09-191-9/+14
|
* Added more tests and handling for short directory namesSteve Dower2019-02-041-2/+8
|
* Fixes #6169: AdjacentTempDirectory should fail on unwritable directorySteve Dower2019-02-041-2/+5
|
* Make failed uninstalls roll back more reliably and better at avoiding naming ↵Steve Dower2019-02-031-3/+7
| | | | conflicts (#6225)
* Fix linting issuesSteve Dower2018-11-211-1/+2
|
* Adds test for AdjacentTempDirectory._generate_namesSteve Dower2018-11-211-4/+6
|
* Remove makedirs callSteve Dower2018-11-211-1/+0
|
* Fixes #3055 Uninstall causes paths to exceed MAX_PATH limitSteve Dower2018-11-211-1/+59
|
* Move all internal APIs to pip._internalDonald Stufft2017-08-311-0/+82