You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All notable changes to this project will be documented in this file.
3
4
4
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -12,54 +13,61 @@ the minified code may only run with Python 3.12.
12
13
13
14
## [Unreleased] - Work in Progress
14
15
15
-
### Added
16
+
### Added Unreleased
17
+
16
18
- Python 3.14 support (work in progress), including:
17
-
+ PEP 750 Template strings (t-strings)
18
-
+ Exception handling without parentheses
19
-
+ PEP 649 Deferred annotation evaluation
19
+
- PEP 750 Template strings (t-strings)
20
+
- Exception handling without parentheses
21
+
- PEP 649 Deferred annotation evaluation
20
22
21
23
## [3.0.0] - 2025-08-13
22
24
23
-
### Fixed
25
+
### Fixed 3.0.0
26
+
24
27
- Better support of unicode on platforms that do not use UTF-8 as the default encoding.
25
28
This should fix issues with minifying files on Windows, and possibly other platforms with very old Python versions.
26
29
27
30
If you are still using Python 2.7 this could be a breaking change - the pyminify command is unchanged, but the `minify()` function now returns unicode strings.
28
31
29
32
## [2.11.3] - 2024-11-12
30
33
31
-
### Fixed
34
+
### Fixed 2.11.3
35
+
32
36
- The special behaviour of assignment expression target binding inside comprehensions was not correctly implemented.
33
37
34
38
This could lead to the analysed scope of these variables being incorrect and the variable being renamed to a name that was
35
39
already in scope.
36
40
37
41
## [2.11.2] - 2024-10-03
38
42
39
-
### Fixed
43
+
### Fixed 2.11.2
44
+
40
45
- Using the positional only parameter separator `/` in method definitions could cause the following parameter to be
41
46
incorrectly renamed in place, which could lead to failure if the method was called with that parameter as a keyword argument.
42
47
This has been fixed.
43
48
44
49
## [2.11.1] - 2024-09-29
45
50
46
-
### Fixed
51
+
### Fixed 2.11.1
52
+
47
53
- Using the `--remove-class-attribute-annotations` option together with `--rename-globals` was incorrectly causing
48
54
class attributes to be renamed. Both of these options are unsafe for arbitrary code and are disabled by default
49
55
but this was not the intended behavior, and has been fixed.
50
56
51
57
## [2.11.0] - 2024-09-26
52
58
53
-
### Added
59
+
### Added 2.11.0
60
+
54
61
- Python 3.13 support, including:
55
-
+ PEP 696 Type parameter defaults
62
+
- PEP 696 Type parameter defaults
56
63
57
64
## [2.10.0] - 2024-09-15
58
65
59
-
### Added
66
+
### Added 2.10.0
67
+
60
68
- Python 3.12 support, including:
61
-
+ PEP 695 Type parameter syntax
62
-
+ PEP 701 Improved f-strings
69
+
- PEP 695 Type parameter syntax
70
+
- PEP 701 Improved f-strings
63
71
64
72
- A new transform to remove the brackets when instantiating and raising built-in exceptions, which is enabled by default.
65
73
e.g.
@@ -90,22 +98,25 @@ the minified code may only run with Python 3.12.
90
98
SECONDS_IN_A_DAY=86400
91
99
```
92
100
93
-
### Changed
101
+
### Changed 2.10.0
102
+
94
103
- Annotation removal is now more configurable, with separate options for:
95
-
+ Removal of variable annotations (`--no-remove-variable-annotations`)
96
-
+ Removal of function return annotations (`--no-remove-return-annotations`)
97
-
+ Removal of function argument annotations (`--no-remove-argument-annotations`)
98
-
+ Removal of class attribute annotations (`--remove-class-attribute-annotations`)
104
+
- Removal of variable annotations (`--no-remove-variable-annotations`)
105
+
- Removal of function return annotations (`--no-remove-return-annotations`)
106
+
- Removal of function argument annotations (`--no-remove-argument-annotations`)
107
+
- Removal of class attribute annotations (`--remove-class-attribute-annotations`)
99
108
100
109
The default behavior has changed, with class attribute annotations no longer removed by default.
101
110
These are increasingly being used at runtime, and removing them can cause issues.
102
111
103
-
### Fixed
112
+
### Fixed 2.10.0
113
+
104
114
- Fixed various subtle issues with renaming of names that overlap class scope.
105
115
106
116
## [2.9.0] - 2023-05-01
107
117
108
-
### Added
118
+
### Added 2.9.0
119
+
109
120
- A new transform to remove `return` statements that are not required, which is enabled by default.
110
121
e.g.
111
122
@@ -134,174 +145,205 @@ the minified code may only run with Python 3.12.
134
145
The debug specifier should now be preserved where it is used in the input source.
135
146
136
147
- Many small improvements to minification to be more precise about where whitespace or parentheses required
137
-
+ Thanks [luk3yx](https://github.com/luk3yx) for improving whitespace in relative import statements.
138
-
+ A generator as the sole argument to a function call is no longer wrapped in parentheses
139
-
+ float literals can use a more compact scientific notation
140
-
+ Many more subtle improvements
148
+
- Thanks [luk3yx](https://github.com/luk3yx) for improving whitespace in relative import statements.
149
+
- A generator as the sole argument to a function call is no longer wrapped in parentheses
150
+
- float literals can use a more compact scientific notation
151
+
- Many more subtle improvements
141
152
142
153
## [2.8.1] - 2023-03-15
143
154
144
-
### Fixed
155
+
### Fixed 2.8.1
156
+
145
157
- A bug shortening names in the iterable of a comprehension when the original name was also used as a target in the comprehension
146
158
e.g. `def f(x): return [x for x in x]` would be incorrectly minified to `def f(x):return[A for A in A]`, instead of `def f(x):return[A for A in x]`.
147
159
148
160
## [2.8.0] - 2022-12-27
149
161
150
-
### Added
162
+
### Added 2.8.0
163
+
151
164
- New transforms that together work similarly to Python's [-O option](https://docs.python.org/3/using/cmdline.html#cmdoption-O)
152
-
+ Remove asserts, which removes assert statements and is disabled by default
153
-
+ Remove debug, which removes any `if` block that tests `__debug__ is True` and is disabled by default
165
+
- Remove asserts, which removes assert statements and is disabled by default
166
+
- Remove debug, which removes any `if` block that tests `__debug__ is True` and is disabled by default
167
+
168
+
### Changed 2.8.0
154
169
155
-
### Changed
156
-
- When minifiying a directory, files ending with '.pyw' will now be minified.
170
+
- When minifying a directory, files ending with '.pyw' will now be minified.
157
171
158
172
## [2.7.0] - 2022-10-27
159
173
160
-
### Added
174
+
### Added 2.7.0
175
+
161
176
- Python 3.11 support, including exception groups syntax
162
177
163
-
### Changed
178
+
### Changed 2.7.0
179
+
164
180
- Improved detection of dataclasses when using the remove annotations transform,
165
181
which suppresses removal of annotations for those classes
166
182
167
-
### Fixed
183
+
### Fixed 2.7.0
184
+
168
185
- Renamed `nonlocal` names could be incorrect if the name isn't local in the immediate parent function scope.
169
186
(or it was bound in the immediate parent, but after the definition of the nested scope)
170
187
171
188
## [2.6.0] - 2022-04-10
172
189
173
-
### Added
190
+
### Added 2.6.0
191
+
174
192
- A new option to preserve the shebang line from the source file, which is enabled by default
175
193
- More flexible file processing options for the `pyminify` command:
176
-
+ A new `--output` argument for writing the minified output to a file without having to use shell redirection
177
-
+ A new `--in-place` option which overwrites the specified path with the minified output
178
-
+`path` arguments may be directories, which minifies all *.py files below that directory
179
-
+ Multiple `path` arguments may be specified, which will all be minified
194
+
- A new `--output` argument for writing the minified output to a file without having to use shell redirection
195
+
- A new `--in-place` option which overwrites the specified path with the minified output
196
+
-`path` arguments may be directories, which minifies all *.py files below that directory
197
+
- Multiple `path` arguments may be specified, which will all be minified
180
198
- Type information is included in the package to enable type checking of the public functions
181
199
182
-
### Fixed
200
+
### Fixed 2.6.0
201
+
183
202
- No longer assumes files read from stdin are utf-8.
184
203
185
204
## [2.5.0] - 2021-10-06
186
205
187
-
### Added
206
+
### Added 2.5.0
207
+
188
208
- Support for Python 3.10, including pattern matching syntax
189
209
190
-
### Changed
210
+
### Changed 2.5.0
211
+
191
212
- Makes better decisions about when renaming is space efficient
192
213
193
214
## [2.4.2] - 2021-06-28
194
215
195
-
### Fixed
216
+
### Fixed 2.4.2
217
+
196
218
- Rare Exceptions when encountering empty f-string str parts
197
219
- Missing required parentheses in return statements for iterable unpacking in python <3.8
198
220
- Missing parentheses in some complex dict expansions
199
221
200
-
### Removed
222
+
### Removed 2.4.2
223
+
201
224
- Python 2.6 support
202
225
203
226
## [2.4.1] - 2020-10-17
204
227
205
-
### Changed
228
+
### Changed 2.4.1
229
+
206
230
- When the remove annotation transformation is enabled, annotations are preserved on detected usage of TypedDict or NamedTuple
207
231
208
232
## [2.4.0] - 2020-10-15
209
233
210
-
### Added
234
+
### Added 2.4.0
235
+
211
236
- Support for Python 3.9, including:
212
-
+ PEP 614 - Relaxing Grammar Restrictions On Decorators
237
+
- PEP 614 - Relaxing Grammar Restrictions On Decorators
213
238
214
239
## [2.3.2] - 2020-10-11
215
240
216
-
### Fixed
241
+
### Fixed 2.3.2
242
+
217
243
- await keyword can now be used in f-string expression parts
218
244
219
245
## [2.3.1] - 2020-05-04
220
246
221
-
### Fixed
247
+
### Fixed 2.3.1
248
+
222
249
-`args` and `kwargs` could have been renamed incorrectly in Python 2.6/2.7, particularly when reminifying a file
223
250
224
251
## [2.3.0] - 2019-11-18
225
252
226
-
### Added
253
+
### Added 2.3.0
254
+
227
255
- Optional source transform:
228
-
+ convert positional arguments to normal arguments, enabled by default
256
+
- convert positional arguments to normal arguments, enabled by default
257
+
258
+
### Fixed 2.3.0
229
259
230
-
### Fixed
231
260
- Unnecessary spaces after ',' in tuple values
232
261
- Removing annotations for positional-only arguments (Thanks [luk3yx](https://github.com/luk3yx)!)
233
262
-`--no-remove-annotations` argument to `pyminify` had no effect
234
263
235
264
## [2.2.1] - 2019-11-03
236
265
237
-
### Fixed
266
+
### Fixed 2.2.1
267
+
238
268
- Unnecessary spaces after ';' in minified output have been removed
239
269
- Fixed PendingDeprecationWarnings
240
270
241
271
## [2.2.0] - 2019-10-27
242
272
243
-
### Added
273
+
### Added 2.2.0
274
+
244
275
- Support for Python 3.8 language features:
245
-
+ Assignment expressions
246
-
+ Positional parameters
247
-
+ f-string = specifier
276
+
- Assignment expressions
277
+
- Positional parameters
278
+
- f-string = specifier
279
+
280
+
### Changed 2.2.0
248
281
249
-
### Changed
250
282
- Removed unnecessary parenthesis around yield statements
251
283
252
-
### Fixed
284
+
### Fixed 2.2.0
285
+
253
286
- Reading from stdin
254
287
255
288
## [2.1.2] - 2019-06-27
256
289
257
-
### Changed
290
+
### Changed 2.1.2
291
+
258
292
- Improved renaming performance
259
293
260
294
## [2.1.1] - 2019-04-07
261
295
262
-
### Changed
296
+
### Changed 2.1.1
297
+
263
298
- Removed redundant parentheses from comprehension iteration values
264
299
265
300
## [2.1.0] - 2019-01-24
266
301
267
-
### Added
302
+
### Added 2.1.0
303
+
268
304
- Optional source transforms:
269
-
+ remove object base, enabled by default
305
+
- remove object base, enabled by default
306
+
307
+
### Changed 2.1.0
270
308
271
-
### Changed
272
309
- Return statements no longer wrap tuples in extraneous parentheses
273
310
- Duplicated literals are only raised to the lowest common function namespace
274
311
275
312
## [2.0.0] - 2019-01-13
276
313
277
-
### Added
314
+
### Added 2.0.0
315
+
278
316
- Optional source transformations:
279
-
+ Rename locals, enabled by default
280
-
+ Rename globals, disabled by default
317
+
- Rename locals, enabled by default
318
+
- Rename globals, disabled by default
319
+
320
+
### Changed 2.0.0
281
321
282
-
### Changed
283
322
- Minified code will no longer have leading or trailing whitespace
284
323
- Generated names for hoisted literals will have an initial underscore if rename globals is disabled
285
324
- Suites of simple statements won't create an indented block
286
325
- All transforms are now functional on all supported python versions
287
326
- The module docstring is not removed by the remove literal statements transformation if there is a name bound for it
288
327
289
-
### Fixed
328
+
### Fixed 2.0.0
329
+
290
330
- Python 3.7 dataclass field annotations are no longer removed when the remove annotation transformation is enabled
291
331
292
332
## [1.1.0] - 2018-06-05
293
333
294
-
### Added
334
+
### Added 1.1.0
335
+
295
336
- Optional source transformations:
296
-
+ Combine import statements
297
-
+ Remove annotations
298
-
+ Remove pass statements
299
-
+ Remove unused literals, including docstrings
300
-
+ Move duplicated literals into module level variables
337
+
- Combine import statements
338
+
- Remove annotations
339
+
- Remove pass statements
340
+
- Remove unused literals, including docstrings
341
+
- Move duplicated literals into module level variables
0 commit comments