Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Developer lists PyInstaller's binary caches

Țugui Dragoș8dc6a549e0bc
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index e92389b8..909e11d8 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -451,6 +451,9 @@ public enum DeveloperCaches {
Folder("Library/Caches/Jedi", .cache, source: "https://github.com/davidhalter/jedi/blob/master/jedi/settings.py#L77-L78"),
Folder("Library/Caches/Parso", .cache, source: "https://github.com/davidhalter/parso/blob/master/parso/cache.py#L69-L70"),
]),
+ Definition(id: "pyinstaller", name: "PyInstaller", systemImage: "chevron.left.forwardslash.chevron.right", appBundleIdentifiers: [], folders: [
+ Folder("Library/Application Support/pyinstaller/bincache*/", .cache, source: "https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/configure.py#L53-L71"),
+ ]),
// Only the package files `pyenv install` keeps, never `versions`, the Pythons it installed.
Definition(id: "pyenv", name: "pyenv", systemImage: "chevron.left.forwardslash.chevron.right", appBundleIdentifiers: [], folders: [
Folder(".pyenv/cache", .downloads, source: "https://github.com/pyenv/pyenv/blob/master/plugins/python-build/bin/pyenv-install#L235-L238"),
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
index d3675c1a..29a1f991 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
@@ -706,6 +706,17 @@ struct DeveloperCachesTests {
#expect(locations.allSatisfy { $0.kind == .downloads })
}
+ @Test func offersOnlyTheBinaryCachesOfPyInstaller() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.file("Library/Application Support/pyinstaller/bincache00_py313_arm64/libpython.dylib", bytes: 400_000)
+ try directory.file("Library/Application Support/pyinstaller/other/state", bytes: 400_000)
+ let pyinstaller = DeveloperCaches.definitions.filter { $0.id == "pyinstaller" }
+
+ let locations = await DeveloperCaches.scan(pyinstaller, homeDirectory: directory.url).flatMap(\.locations)
+
+ #expect(locations.map(\.url.lastPathComponent) == ["bincache00_py313_arm64"])
+ }
+
/// virtualenvwrapper keeps the user's hook scripts beside the environments in `~/.virtualenvs`, so only the
/// environments are offered, and a link among them is left where it is, never followed.
@Test func offersVirtualenvwrappersEnvironmentsAndNotItsHooks() async throws {