Skip to content

Commit 55830f2

Browse files
authored
Fix: update python minifier to 3.1.1 (#53)
* fix: update python minifier to 3.1.1 * refactor: preserve default settings
1 parent 45557ab commit 55830f2

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def combine(dst):
8888
gen_translations("./src/lang/", "build/translations.json")
8989
gen_manifest("./src/manifest.json", "build/manifest.json")
9090

91-
download_and_extract("https://github.com/dflook/python-minifier/archive/refs/tags/2.11.0.zip",
92-
"python-minifier-2.11.0/src/python_minifier/",
91+
download_and_extract("https://github.com/dflook/python-minifier/archive/refs/tags/3.1.1.zip",
92+
"python-minifier-3.1.1/src/python_minifier/",
9393
"src/tools_vfs/lib/python_minifier")
9494
gen_tar("src/tools_vfs", "build/assets/tools_vfs.tar.gz")
9595
gen_tar("src/vm_vfs", "build/assets/vm_vfs.tar.gz")

src/python_utils.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,8 @@ with open('/tmp/file.py') as f:
213213
d = f.read()
214214
d = python_minifier.minify(
215215
d,
216-
remove_annotations=True,
217-
remove_pass=True,
218216
remove_literal_statements=True,
219-
combine_imports=True,
220-
hoist_literals=False,
221-
remove_object_base=False,
222-
remove_debug=True,
223-
remove_asserts=False,
224-
rename_locals=True, preserve_locals=None,
225-
rename_globals=False, preserve_globals=None,
226-
convert_posargs_to_args=True,
227-
preserve_shebang=False,
217+
hoist_literals=False
228218
)
229219
with open('/tmp/file.min.py', 'w') as f:
230220
f.write(d)
@@ -263,3 +253,4 @@ f.close()
263253

264254
return vm.FS.readFile("/tmp/file.mpy.dis", { encoding: 'utf8' })
265255
}
256+

0 commit comments

Comments
 (0)