Skip to content

Commit 08c3f0a

Browse files
committed
1 parent 052c13a commit 08c3f0a

File tree

2 files changed

+141
-99
lines changed

2 files changed

+141
-99
lines changed

CHANGELOG.md

Lines changed: 117 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
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.
1213

1314
## [Unreleased] - Work in Progress
1415

15-
### Added
16+
### Added Unreleased
17+
1618
- 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
2022

2123
## [3.0.0] - 2025-08-13
2224

23-
### Fixed
25+
### Fixed 3.0.0
26+
2427
- Better support of unicode on platforms that do not use UTF-8 as the default encoding.
2528
This should fix issues with minifying files on Windows, and possibly other platforms with very old Python versions.
2629

2730
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.
2831

2932
## [2.11.3] - 2024-11-12
3033

31-
### Fixed
34+
### Fixed 2.11.3
35+
3236
- The special behaviour of assignment expression target binding inside comprehensions was not correctly implemented.
3337

3438
This could lead to the analysed scope of these variables being incorrect and the variable being renamed to a name that was
3539
already in scope.
3640

3741
## [2.11.2] - 2024-10-03
3842

39-
### Fixed
43+
### Fixed 2.11.2
44+
4045
- Using the positional only parameter separator `/` in method definitions could cause the following parameter to be
4146
incorrectly renamed in place, which could lead to failure if the method was called with that parameter as a keyword argument.
4247
This has been fixed.
4348

4449
## [2.11.1] - 2024-09-29
4550

46-
### Fixed
51+
### Fixed 2.11.1
52+
4753
- Using the `--remove-class-attribute-annotations` option together with `--rename-globals` was incorrectly causing
4854
class attributes to be renamed. Both of these options are unsafe for arbitrary code and are disabled by default
4955
but this was not the intended behavior, and has been fixed.
5056

5157
## [2.11.0] - 2024-09-26
5258

53-
### Added
59+
### Added 2.11.0
60+
5461
- Python 3.13 support, including:
55-
+ PEP 696 Type parameter defaults
62+
- PEP 696 Type parameter defaults
5663

5764
## [2.10.0] - 2024-09-15
5865

59-
### Added
66+
### Added 2.10.0
67+
6068
- 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
6371

6472
- A new transform to remove the brackets when instantiating and raising built-in exceptions, which is enabled by default.
6573
e.g.
@@ -90,22 +98,25 @@ the minified code may only run with Python 3.12.
9098
SECONDS_IN_A_DAY=86400
9199
```
92100

93-
### Changed
101+
### Changed 2.10.0
102+
94103
- 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`)
99108

100109
The default behavior has changed, with class attribute annotations no longer removed by default.
101110
These are increasingly being used at runtime, and removing them can cause issues.
102111

103-
### Fixed
112+
### Fixed 2.10.0
113+
104114
- Fixed various subtle issues with renaming of names that overlap class scope.
105115

106116
## [2.9.0] - 2023-05-01
107117

108-
### Added
118+
### Added 2.9.0
119+
109120
- A new transform to remove `return` statements that are not required, which is enabled by default.
110121
e.g.
111122

@@ -134,174 +145,205 @@ the minified code may only run with Python 3.12.
134145
The debug specifier should now be preserved where it is used in the input source.
135146

136147
- 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
141152

142153
## [2.8.1] - 2023-03-15
143154

144-
### Fixed
155+
### Fixed 2.8.1
156+
145157
- A bug shortening names in the iterable of a comprehension when the original name was also used as a target in the comprehension
146158
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]`.
147159

148160
## [2.8.0] - 2022-12-27
149161

150-
### Added
162+
### Added 2.8.0
163+
151164
- 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
154169

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.
157171

158172
## [2.7.0] - 2022-10-27
159173

160-
### Added
174+
### Added 2.7.0
175+
161176
- Python 3.11 support, including exception groups syntax
162177

163-
### Changed
178+
### Changed 2.7.0
179+
164180
- Improved detection of dataclasses when using the remove annotations transform,
165181
which suppresses removal of annotations for those classes
166182

167-
### Fixed
183+
### Fixed 2.7.0
184+
168185
- Renamed `nonlocal` names could be incorrect if the name isn't local in the immediate parent function scope.
169186
(or it was bound in the immediate parent, but after the definition of the nested scope)
170187

171188
## [2.6.0] - 2022-04-10
172189

173-
### Added
190+
### Added 2.6.0
191+
174192
- A new option to preserve the shebang line from the source file, which is enabled by default
175193
- 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
180198
- Type information is included in the package to enable type checking of the public functions
181199

182-
### Fixed
200+
### Fixed 2.6.0
201+
183202
- No longer assumes files read from stdin are utf-8.
184203

185204
## [2.5.0] - 2021-10-06
186205

187-
### Added
206+
### Added 2.5.0
207+
188208
- Support for Python 3.10, including pattern matching syntax
189209

190-
### Changed
210+
### Changed 2.5.0
211+
191212
- Makes better decisions about when renaming is space efficient
192213

193214
## [2.4.2] - 2021-06-28
194215

195-
### Fixed
216+
### Fixed 2.4.2
217+
196218
- Rare Exceptions when encountering empty f-string str parts
197219
- Missing required parentheses in return statements for iterable unpacking in python <3.8
198220
- Missing parentheses in some complex dict expansions
199221

200-
### Removed
222+
### Removed 2.4.2
223+
201224
- Python 2.6 support
202225

203226
## [2.4.1] - 2020-10-17
204227

205-
### Changed
228+
### Changed 2.4.1
229+
206230
- When the remove annotation transformation is enabled, annotations are preserved on detected usage of TypedDict or NamedTuple
207231

208232
## [2.4.0] - 2020-10-15
209233

210-
### Added
234+
### Added 2.4.0
235+
211236
- Support for Python 3.9, including:
212-
+ PEP 614 - Relaxing Grammar Restrictions On Decorators
237+
- PEP 614 - Relaxing Grammar Restrictions On Decorators
213238

214239
## [2.3.2] - 2020-10-11
215240

216-
### Fixed
241+
### Fixed 2.3.2
242+
217243
- await keyword can now be used in f-string expression parts
218244

219245
## [2.3.1] - 2020-05-04
220246

221-
### Fixed
247+
### Fixed 2.3.1
248+
222249
- `args` and `kwargs` could have been renamed incorrectly in Python 2.6/2.7, particularly when reminifying a file
223250

224251
## [2.3.0] - 2019-11-18
225252

226-
### Added
253+
### Added 2.3.0
254+
227255
- 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
229259

230-
### Fixed
231260
- Unnecessary spaces after ',' in tuple values
232261
- Removing annotations for positional-only arguments (Thanks [luk3yx](https://github.com/luk3yx)!)
233262
- `--no-remove-annotations` argument to `pyminify` had no effect
234263

235264
## [2.2.1] - 2019-11-03
236265

237-
### Fixed
266+
### Fixed 2.2.1
267+
238268
- Unnecessary spaces after ';' in minified output have been removed
239269
- Fixed PendingDeprecationWarnings
240270

241271
## [2.2.0] - 2019-10-27
242272

243-
### Added
273+
### Added 2.2.0
274+
244275
- 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
248281

249-
### Changed
250282
- Removed unnecessary parenthesis around yield statements
251283

252-
### Fixed
284+
### Fixed 2.2.0
285+
253286
- Reading from stdin
254287

255288
## [2.1.2] - 2019-06-27
256289

257-
### Changed
290+
### Changed 2.1.2
291+
258292
- Improved renaming performance
259293

260294
## [2.1.1] - 2019-04-07
261295

262-
### Changed
296+
### Changed 2.1.1
297+
263298
- Removed redundant parentheses from comprehension iteration values
264299

265300
## [2.1.0] - 2019-01-24
266301

267-
### Added
302+
### Added 2.1.0
303+
268304
- Optional source transforms:
269-
+ remove object base, enabled by default
305+
- remove object base, enabled by default
306+
307+
### Changed 2.1.0
270308

271-
### Changed
272309
- Return statements no longer wrap tuples in extraneous parentheses
273310
- Duplicated literals are only raised to the lowest common function namespace
274311

275312
## [2.0.0] - 2019-01-13
276313

277-
### Added
314+
### Added 2.0.0
315+
278316
- 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
281321

282-
### Changed
283322
- Minified code will no longer have leading or trailing whitespace
284323
- Generated names for hoisted literals will have an initial underscore if rename globals is disabled
285324
- Suites of simple statements won't create an indented block
286325
- All transforms are now functional on all supported python versions
287326
- The module docstring is not removed by the remove literal statements transformation if there is a name bound for it
288327

289-
### Fixed
328+
### Fixed 2.0.0
329+
290330
- Python 3.7 dataclass field annotations are no longer removed when the remove annotation transformation is enabled
291331

292332
## [1.1.0] - 2018-06-05
293333

294-
### Added
334+
### Added 1.1.0
335+
295336
- 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
301342

302343
## [1.0.0] - 2018-05-25
303344

304-
### Added
345+
### Added 1.0.0
346+
305347
- python-minifier package
306348
- pyminify command
307349

0 commit comments

Comments
 (0)