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.

Offer the environments Pixi makes in Build Artifacts

Țugui Dragoș2b14eff00f8e
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
index 00d6214c..402e3f8f 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
@@ -331,6 +331,12 @@ public enum ProjectArtifacts {
name: ".nox", markers: ["noxfile.py"], tool: "Nox", isGeneric: false, isEnvironment: true,
source: "https://nox.thea.codes/en/stable/usage.html"
),
+ // Pixi makes these again from `pixi.lock` and never lets them be edited by hand; `.pixi` also holds the
+ // project's own `config.toml`.
+ Definition(
+ name: ".pixi/envs", markers: ["pixi.toml", "pyproject.toml"], tool: "Pixi", isGeneric: false,
+ source: "https://github.com/prefix-dev/pixi/blob/98535e0857e25ddc89457ef4779be2a961d8c2df/docs/workspace/environment.md#L70-L141"
+ ),
Definition(
name: "dist", markers: ["pyproject.toml"], tool: "Python", isGeneric: true,
source: "https://packaging.python.org/en/latest/tutorials/packaging-projects/"
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
index 715994f1..e80f63ec 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
@@ -416,6 +416,20 @@ struct ProjectArtifactsTests {
#expect(found.first?.isRecommended == true)
}
+ @Test func offersTheEnvironmentsPixiMakesAgainAndNeverItsSettings() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.file("science/pixi.toml", bytes: 16)
+ try directory.file("science/.pixi/envs/default/conda-meta/pixi", bytes: 400_000)
+ try directory.file("science/.pixi/config.toml", bytes: 16)
+ try age(directory.url, days: 60)
+
+ let found = await ProjectArtifacts.scan(roots: [directory.url]).artifacts
+
+ #expect(found.map(\.name) == [".pixi/envs"])
+ #expect(found.first?.tool == "Pixi")
+ #expect(found.first?.isRecommended == true)
+ }
+
@Test func offersTheClasspathCacheTheClojureCLIKeepsInAProject() async throws {
let directory = try TemporaryDirectory()
try directory.file("app/deps.edn", bytes: 16)
diff --git a/SAFETY.md b/SAFETY.md
index 08fc726c..b71556d7 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -331,7 +331,8 @@ includes `node_modules` and `Pods`, which `npm install` and `pod install` put ba
is part of the project, so it is listed and never selected, and so is one in a repository whose list of tracked files
Peel can't read. Peel reads that list from Git's own index, as Git documents it, and never runs Git in a project. A
Python environment (`.venv`, `venv`) is listed and never selected, since packages are often installed into one by hand,
-and so is Terraform's `.terraform`, which keeps the workspace you chose. A folder whose name says nothing on its own,
+and so is Terraform's `.terraform`, which keeps the workspace you chose. Pixi's `.pixi/envs` can be suggested: Pixi
+makes it again from `pixi.lock` and never lets it be edited by hand. A folder whose name says nothing on its own,
such as `target` or `build`, is listed and never selected either. Of a Godot project's `.godot`, only the caches Godot
makes again are offered, `imported` and `shader_cache`: the folder also holds the export passwords and keys
(`export_credentials.cfg`), which exist nowhere else. Nx's `.nx` is offered only when it holds nothing but the cache