devjanitor 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {devjanitor-0.1.1 → devjanitor-0.1.2}/PKG-INFO +9 -4
- {devjanitor-0.1.1 → devjanitor-0.1.2}/README.md +1 -3
- devjanitor-0.1.2/demo/demo.gif +0 -0
- devjanitor-0.1.2/demo/demo.tape +43 -0
- devjanitor-0.1.2/demo/make_demo.py +66 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/pyproject.toml +7 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/src/devjanitor/__init__.py +1 -1
- devjanitor-0.1.1/demo.tape +0 -12
- {devjanitor-0.1.1 → devjanitor-0.1.2}/.github/workflows/ci.yml +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/.github/workflows/publish.yml +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/.gitignore +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/LICENSE +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/src/devjanitor/__main__.py +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/src/devjanitor/caches.py +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/src/devjanitor/cli.py +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/src/devjanitor/scanner.py +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/src/devjanitor/targets.py +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/src/devjanitor/utils.py +0 -0
- {devjanitor-0.1.1 → devjanitor-0.1.2}/tests/test_devjanitor.py +0 -0
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: devjanitor
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Find and delete node_modules, .venv, target/ and other dev junk to free disk space.
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Keywords: cleanup,cli,developer-tools,disk-space,node_modules,venv
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
9
|
Classifier: Environment :: Console
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
11
|
Classifier: Operating System :: OS Independent
|
|
11
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
19
|
Classifier: Topic :: System :: Filesystems
|
|
13
20
|
Classifier: Topic :: Utilities
|
|
14
21
|
Requires-Python: >=3.9
|
|
@@ -26,9 +33,7 @@ Description-Content-Type: text/markdown
|
|
|
26
33
|
|
|
27
34
|
**Find the projects you forgot about and delete their `node_modules`, `.venv`, `target/` and build output. Every language, one command.**
|
|
28
35
|
|
|
29
|
-
|
|
30
|
-

|
|
31
|
-
-->
|
|
36
|
+

|
|
32
37
|
|
|
33
38
|
```console
|
|
34
39
|
$ devjanitor ~/code --older-than 90
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
**Find the projects you forgot about and delete their `node_modules`, `.venv`, `target/` and build output. Every language, one command.**
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-

|
|
12
|
-
-->
|
|
10
|
+

|
|
13
11
|
|
|
14
12
|
```console
|
|
15
13
|
$ devjanitor ~/code --older-than 90
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Records demo/demo.gif for the README. From the repo root:
|
|
2
|
+
# pip install -e . (so `devjanitor` is on PATH, e.g. inside .venv)
|
|
3
|
+
# vhs demo/demo.tape
|
|
4
|
+
# Uses a throwaway fake ~/code (demo/make_demo.py), never your real projects.
|
|
5
|
+
|
|
6
|
+
Output demo/demo.gif
|
|
7
|
+
|
|
8
|
+
Set Shell "bash"
|
|
9
|
+
Set FontSize 18
|
|
10
|
+
Set Width 1180
|
|
11
|
+
Set Height 460
|
|
12
|
+
Set Padding 24
|
|
13
|
+
Set Theme "Catppuccin Mocha"
|
|
14
|
+
Set TypingSpeed 55ms
|
|
15
|
+
Set WindowBar Colorful
|
|
16
|
+
|
|
17
|
+
Hide
|
|
18
|
+
Type `export PATH="$PWD/.venv/bin:$PATH" DEMO="${TMPDIR:-/tmp}/devjanitor-demo"`
|
|
19
|
+
Enter
|
|
20
|
+
Type `python3 demo/make_demo.py "$DEMO/code" && export HOME="$DEMO" PS1='\[\e[1;36m\]$ \[\e[0m\]' && cd ~ && clear`
|
|
21
|
+
Enter
|
|
22
|
+
Sleep 4s
|
|
23
|
+
Show
|
|
24
|
+
|
|
25
|
+
Sleep 600ms
|
|
26
|
+
Type "devjanitor ~/code --older-than 90"
|
|
27
|
+
Sleep 600ms
|
|
28
|
+
Enter
|
|
29
|
+
Sleep 3.5s
|
|
30
|
+
|
|
31
|
+
Type "all"
|
|
32
|
+
Sleep 700ms
|
|
33
|
+
Enter
|
|
34
|
+
Sleep 900ms
|
|
35
|
+
Type "y"
|
|
36
|
+
Sleep 500ms
|
|
37
|
+
Enter
|
|
38
|
+
Sleep 4.5s
|
|
39
|
+
|
|
40
|
+
Hide
|
|
41
|
+
Type `rm -rf "$DEMO"`
|
|
42
|
+
Enter
|
|
43
|
+
Sleep 500ms
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Create a fake ~/code folder for recording the README demo (see demo.tape).
|
|
2
|
+
|
|
3
|
+
python demo/make_demo.py /tmp/devjanitor-demo/code
|
|
4
|
+
|
|
5
|
+
Writes about 3 GB of zero-filled files and backdates each project so that
|
|
6
|
+
``--older-than`` has something to show. Delete the folder when done.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import os
|
|
10
|
+
import shutil
|
|
11
|
+
import sys
|
|
12
|
+
import time
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
MB = 1024 * 1024
|
|
16
|
+
DAY = 86400
|
|
17
|
+
|
|
18
|
+
# project, marker files, junk dir, files inside junk dir, size in MB, days since last change
|
|
19
|
+
PROJECTS = [
|
|
20
|
+
("ml-experiments", ["pyproject.toml", "train.py"], ".venv",
|
|
21
|
+
["pyvenv.cfg", "lib/python3.12/site-packages/torch/lib/libtorch_cpu.dylib"], 900, 150),
|
|
22
|
+
("old-hackathon", ["package.json", "index.js"], "node_modules",
|
|
23
|
+
["next/dist/compiled/bundle.js", "@swc/core/swc.node"], 610, 730),
|
|
24
|
+
("current-project", ["package.json", "src.ts"], "node_modules",
|
|
25
|
+
["typescript/lib/typescript.js"], 480, 0),
|
|
26
|
+
("rust-playground", ["Cargo.toml", "main.rs"], "target",
|
|
27
|
+
["debug/deps/librustc.rlib", "debug/playground"], 430, 240),
|
|
28
|
+
("android-app", ["build.gradle", "settings.gradle"], "build",
|
|
29
|
+
["intermediates/dex/classes.dex"], 310, 300),
|
|
30
|
+
("portfolio-v1", ["package.json", "next.config.js"], ".next",
|
|
31
|
+
["cache/webpack/client.pack"], 180, 400),
|
|
32
|
+
("flutter-todo", ["pubspec.yaml", "main.dart"], ".dart_tool",
|
|
33
|
+
["flutter_build/app.dill"], 120, 210),
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def write(path: Path, size: int) -> None:
|
|
38
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
39
|
+
chunk = b"\0" * MB
|
|
40
|
+
with open(path, "wb") as f:
|
|
41
|
+
for _ in range(size // MB):
|
|
42
|
+
f.write(chunk)
|
|
43
|
+
f.write(b"\0" * (size % MB))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def main(root: Path) -> None:
|
|
47
|
+
if root.exists():
|
|
48
|
+
shutil.rmtree(root)
|
|
49
|
+
now = time.time()
|
|
50
|
+
for name, markers, junk, files, size_mb, age_days in PROJECTS:
|
|
51
|
+
project = root / name
|
|
52
|
+
for marker in markers:
|
|
53
|
+
write(project / marker, 2048)
|
|
54
|
+
big = [f for f in files if f != "pyvenv.cfg"]
|
|
55
|
+
for rel in files:
|
|
56
|
+
write(project / junk / rel, size_mb * MB // len(big) if rel in big else 64)
|
|
57
|
+
old = now - age_days * DAY
|
|
58
|
+
for entry in project.iterdir():
|
|
59
|
+
if entry.name != junk:
|
|
60
|
+
os.utime(entry, (old, old))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
if len(sys.argv) != 2:
|
|
65
|
+
sys.exit(__doc__)
|
|
66
|
+
main(Path(sys.argv[1]).expanduser())
|
|
@@ -16,6 +16,13 @@ classifiers = [
|
|
|
16
16
|
"Intended Audience :: Developers",
|
|
17
17
|
"Operating System :: OS Independent",
|
|
18
18
|
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
"Development Status :: 4 - Beta",
|
|
19
26
|
"Topic :: System :: Filesystems",
|
|
20
27
|
"Topic :: Utilities",
|
|
21
28
|
]
|
devjanitor-0.1.1/demo.tape
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Record the README GIF with https://github.com/charmbracelet/vhs : vhs demo.tape
|
|
2
|
-
Output demo.gif
|
|
3
|
-
Set FontSize 16
|
|
4
|
-
Set Width 1100
|
|
5
|
-
Set Height 600
|
|
6
|
-
Set Theme "Catppuccin Mocha"
|
|
7
|
-
Type "devjanitor ~/code" Sleep 500ms Enter
|
|
8
|
-
Sleep 4s
|
|
9
|
-
Type "all" Sleep 500ms Enter
|
|
10
|
-
Sleep 1s
|
|
11
|
-
Type "y" Sleep 300ms Enter
|
|
12
|
-
Sleep 4s
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|