1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
Commit graph

11 commits

Author SHA1 Message Date
Ales Erjavec 660dafb37f Ignore errors in temporary directory cleanup
pip should not exit with an error when it fails to cleanup temporary
files after it has already successfully installed packages.
2023-07-17 15:15:41 +02:00
Tzu-ping Chung 42359a9605 Migrate tests to use pathlib.Path
The pip-specific Path implementation has been removed, and all its
usages replaced by pathlib.Path. The tmpdir and tmpdir_factory fixtures
are also removed, and all usages are replaced by tmp_path and
tmp_path_factory, which use pathlib.Path.

The pip() function now also accepts pathlib.Path so we don't need to put
str() everywhere. Path arguments are coerced with os.fspath() into str.
2022-06-08 19:58:46 +08:00
Jon Dufresne 60c274be2d Complete type annotations of tests/unit/ directory 2021-09-23 05:44:54 -07:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
Chris Hunt 45991bcc1e Use explicit default value for TempDirectory delete flag
Now we can opt-in to globally-managed + globally-configured file
deletion for pre-existing directories by passing an explicit `None`.
2020-01-29 23:04:14 -05:00
Tzu-ping Chung 35377c995c Add test for tempdir registry lazy eval 2020-01-19 18:22:14 +07:00
Chris Hunt 0a57e4e9f2 Manage temp directory deletion centrally
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).
2020-01-10 11:08:05 +01:00
Chris Hunt 0457826bd0 Add global TempDirectory manager
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.
2019-12-09 06:06:37 +08:00
Chris Hunt e6bde63620 Assert TempDirectory.path has not been cleaned up on access 2019-09-23 20:09:04 -04:00
Chris Hunt 7ea1fcdb13 Remove outer class for temp_dir tests 2019-09-23 18:49:12 -04:00
Chris Hunt 236fb82a1f Move temp_dir tests to separate file 2019-09-23 18:47:28 -04:00