Releases: dflook/python-minifier
Releases · dflook/python-minifier
2.8.1
Fixed
- A bug shortening names in the iterable of a comprehension when the original name was also used as a target in the comprehension
e.g.def f(x): return [x for x in x]would be incorrectly minified todef f(x):return[A for A in A], instead ofdef f(x):return[A for A in x].
2.8.0
Added
- New transforms that together work similarly to Python's -O option
- Remove asserts, which removes assert statements and is disabled by default
- Remove debug, which removes any
ifblock that tests__debug__ is Trueand is disabled by default
Changed
- When minifiying a directory, files ending with '.pyw' will now be minified.
2.7.0
Added
- Python 3.11 support, including exception groups syntax
Changed
- Improved detection of dataclasses when using the remove annotations transform, which suppresses removal of annotations for those classes
Fixed
- Renamed
nonlocalnames could be incorrect if the name isn't local in the immediate parent function scope.
(or it was bound in the immediate parent, but after the definition of the nested scope)
2.6.0
Added
- A new option to preserve the shebang line from the source file, which is enabled by default
- More flexible file processing options for the
pyminifycommand:- A new
--outputargument for writing the minified output to a file without having to use shell redirection - A new
--in-placeoption which overwrites the specified path with the minified output patharguments may be directories, which minifies all *.py files below that directory- Multiple
patharguments may be specified, which will all be minified
- A new
- Type information is included in the package to enable type checking of the public functions
Fixed
- No longer assumes files read from stdin are utf-8.
2.5.0
2.4.2
Fixed
- Rare Exceptions when encountering empty f-string str parts
- Missing required parentheses in return statements for iterable unpacking in python <3.8
- Missing parentheses in some complex dict expansions
Removed
- Python 2.6 support