auto-code-fixer 0.3.3__tar.gz → 0.3.4__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.
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/PKG-INFO +1 -1
- auto_code_fixer-0.3.4/auto_code_fixer/__init__.py +1 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/cli.py +16 -3
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer.egg-info/PKG-INFO +1 -1
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/pyproject.toml +1 -1
- auto_code_fixer-0.3.3/auto_code_fixer/__init__.py +0 -1
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/LICENSE +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/README.md +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/command_runner.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/fixer.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/installer.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/models.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/patcher.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/plan.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/runner.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/sandbox.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/traceback_utils.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/utils.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer/venv_manager.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer.egg-info/SOURCES.txt +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer.egg-info/dependency_links.txt +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer.egg-info/entry_points.txt +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer.egg-info/requires.txt +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer.egg-info/top_level.txt +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/setup.cfg +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/tests/test_fix_imported_file.py +0 -0
- {auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/tests/test_internal_imports.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.4"
|
|
@@ -29,6 +29,19 @@ def fix_file(file_path, project_root, api_key, ask, verbose, *, dry_run: bool, m
|
|
|
29
29
|
from auto_code_fixer.sandbox import make_sandbox
|
|
30
30
|
sandbox_root, sandbox_entry = make_sandbox(entry_file=file_path, project_root=project_root)
|
|
31
31
|
|
|
32
|
+
# Always delete temp sandbox (best-effort). Also register atexit cleanup in case of crashes.
|
|
33
|
+
import atexit
|
|
34
|
+
|
|
35
|
+
def cleanup_sandbox() -> None:
|
|
36
|
+
try:
|
|
37
|
+
shutil.rmtree(sandbox_root)
|
|
38
|
+
except FileNotFoundError:
|
|
39
|
+
return
|
|
40
|
+
except Exception as e:
|
|
41
|
+
log(f"WARN: failed to delete sandbox dir {sandbox_root}: {e}")
|
|
42
|
+
|
|
43
|
+
atexit.register(cleanup_sandbox)
|
|
44
|
+
|
|
32
45
|
# Create isolated venv in sandbox
|
|
33
46
|
from auto_code_fixer.venv_manager import create_venv
|
|
34
47
|
from auto_code_fixer.patcher import backup_file
|
|
@@ -82,7 +95,7 @@ def fix_file(file_path, project_root, api_key, ask, verbose, *, dry_run: bool, m
|
|
|
82
95
|
|
|
83
96
|
if confirm != "y":
|
|
84
97
|
log("User declined overwrite", "WARN")
|
|
85
|
-
|
|
98
|
+
cleanup_sandbox()
|
|
86
99
|
return False
|
|
87
100
|
|
|
88
101
|
if dry_run:
|
|
@@ -126,7 +139,7 @@ def fix_file(file_path, project_root, api_key, ask, verbose, *, dry_run: bool, m
|
|
|
126
139
|
shutil.copy(p_real, dst_real)
|
|
127
140
|
log(f"File updated: {dst_real}")
|
|
128
141
|
|
|
129
|
-
|
|
142
|
+
cleanup_sandbox()
|
|
130
143
|
log(f"Fix completed in {attempt + 1} attempt(s) 🎉")
|
|
131
144
|
return True
|
|
132
145
|
|
|
@@ -194,7 +207,7 @@ def fix_file(file_path, project_root, api_key, ask, verbose, *, dry_run: bool, m
|
|
|
194
207
|
time.sleep(1)
|
|
195
208
|
|
|
196
209
|
log("Failed to auto-fix file after max retries ❌", "ERROR")
|
|
197
|
-
|
|
210
|
+
cleanup_sandbox()
|
|
198
211
|
return False
|
|
199
212
|
|
|
200
213
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.3"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_code_fixer-0.3.3 → auto_code_fixer-0.3.4}/auto_code_fixer.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|