All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.8.0 - 2022-12-27
- 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
- When minifiying a directory, files ending with '.pyw' will now be minified.
2.7.0 - 2022-10-27
- Python 3.11 support, including exception groups syntax
- Improved detection of dataclasses when using the remove annotations transform, which suppresses removal of annotations for those classes
- 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 - 2022-04-10
- 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
- No longer assumes files read from stdin are utf-8.
2.5.0 - 2021-10-06
- Support for Python 3.10, including pattern matching syntax
- Makes better decisions about when renaming is space efficient
2.4.2 - 2021-06-28
- 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
- Python 2.6 support
2.4.1 - 2020-10-17
- When the remove annotation transformation is enabled, annotations are preserved on detected usage of TypedDict or NamedTuple
2.4.0 - 2020-10-15
- Support for Python 3.9, including:
- PEP 614 - Relaxing Grammar Restrictions On Decorators
2.3.2 - 2020-10-11
- await keyword can now be used in f-string expression parts
2.3.1 - 2020-05-04
argsandkwargscould have been renamed incorrectly in Python 2.6/2.7, particularly when reminifying a file
2.3.0 - 2019-11-18
- Optional source transform:
- convert positional arguments to normal arguments, enabled by default
- Unnecessary spaces after ',' in tuple values
- Removing annotations for positional-only arguments (Thanks luk3yx!)
--no-remove-annotationsargument topyminifyhad no effect
2.2.1 - 2019-11-03
- Unnecessary spaces after ';' in minified output have been removed
- Fixed PendingDeprecationWarnings
2.2.0 - 2019-10-27
- Support for Python 3.8 language features:
- Assignment expressions
- Positional parameters
- f-string = specifier
- Removed unnecessary parenthesis around yield statements
- Reading from stdin
2.1.2 - 2019-06-27
- Improved renaming performance
2.1.1 - 2019-04-07
- Removed redundant parentheses from comprehension iteration values
2.1.0 - 2019-01-24
- Optional source transforms:
- remove object base, enabled by default
- Return statements no longer wrap tuples in extraneous parentheses
- Duplicated literals are only raised to the lowest common function namespace
2.0.0 - 2019-01-13
- Optional source transformations:
- Rename locals, enabled by default
- Rename globals, disabled by default
- Minified code will no longer have leading or trailing whitespace
- Generated names for hoisted literals will have an initial underscore if rename globals is disabled
- Suites of simple statements won't create an indented block
- All transforms are now functional on all supported python versions
- The module docstring is not removed by the remove literal statements transformation if there is a name bound for it
- Python 3.7 dataclass field annotations are no longer removed when the remove annotation transformation is enabled
1.1.0 - 2018-06-05
- Optional source transformations:
- Combine import statements
- Remove annotations
- Remove pass statements
- Remove unused literals, including docstrings
- Move duplicated literals into module level variables
1.0.0 - 2018-05-25
- python-minifier package
- pyminify command