CHANGELOG.md 17.6 KB
Newer Older
Timothy Crosley's avatar
Timothy Crosley 已提交
1
2
Changelog
=========
3

4
NOTE: isort follows the [semver](https://semver.org/) versioning standard.
Timothy Crosley's avatar
Fixed    
Timothy Crosley 已提交
5

6
### 5.1.0 July TBD, 2020
7
  - isort now throws an exception if an invalid settings path is given (issue #1174).
8
  - Implemented support for automatic redundant alias removal (issue #1281).
9
  - Implemented experimental support for floating all imports to the top of a file (issue #1228)
10
  - Fixed #1178: support for semicolons in decorators.
11
  - Fixed #1315: Extra newline before comment with -n + --fss.
12
  - Fixed #1192: `-k` or `--keep-direct-and-as-imports` option has been deprecated as it is now always on.
13

14
15
**Formatting changes implied:**
  - Fixed #1280: rewrite of as imports changes the behavior of the imports.
16

17
### 5.0.9 July 11, 2020
18
is
19

20
21
### 5.0.8 July 11, 2020
  - Fixed #1277 & #1278: New line detection issues on Windows.
22
  - Fixed #1294: Fix bundled git hook.
23

24
25
### 5.0.7 July 9, 2020
  - Fixed #1306: unexpected --diff behavior.
26
  - Fixed #1279: Fixed NOQA comment regression.
27

Timothy Crosley's avatar
Fixed    
Timothy Crosley 已提交
28
### 5.0.6 July 8, 2020
29
30
  - Fixed #1302: comments and --trailing-comma can generate invalid code.
  - Fixed #1293: extra new line in indented imports, when immediately followed by a comment.
31
  - Fixed #1304: isort 5 no longer recognises `sre_parse` as a stdlib module.
32
  - Fixed #1300: add_imports moves comments following import section.
33
  - Fixed #1276: Fix a bug that creates only one line after triple quotes.
Timothy Crosley's avatar
Fixed    
Timothy Crosley 已提交
34

35
### 5.0.5 July 7, 2020
36
  - Fixed #1285: packaging issue with bundling tests via poetry.
37
  - Fixed #1284: Regression when sorting `.pyi` files from CLI using black profile.
38
  - Fixed #1275 & #1283: Blank line after docstring removed.
39
  - Fixed #1298: CLI Help out of date with isort 5.
40
  - Fixed #1290: Unecessary blank lines above nested imports when import comments turned on.
41
  - Fixed #1297: Usage of `--add-imports` alongside `--check` is broken.
42
  - Fixed #1289: Stream usage no longer auto picking up config file from current working directory.
43
  - Fixed #1296: Force_single_line setting removes immediately following comment line.
44
  - Fixed #1295: `ensure_newline_before_comments` doesnt work with `force_sort_within_sections`.
45
46
  - Setting not_skip will no longer immediately fail but instead give user a warning and direct
    to upgrade docs.
47

Timothy Crosley's avatar
Timothy Crosley 已提交
48
49
50
51
### 5.0.4 July 6, 2020
  - Fixed #1264: a regression with comment handling and `force_sort_within_sections` config option
  - Added warning for deprecated CLI flags and linked to upgrade guide.

52
53
54
### 5.0.3 - July 4, 2020
  - Fixed setup.py command incorrectly passing check=True as a configuration parameter (see: https://github.com/timothycrosley/isort/issues/1258)
  - Fixed missing patch version
55
  - Fixed issue #1253: Atomic fails when passed in not readable output stream
56

57
58
59
### 5.0.2 - July 4, 2020
  - Ensured black profile was complete, adding missing line_length definition.

Timothy Crosley's avatar
Timothy Crosley 已提交
60
61
62
### 5.0.1 - July 4, 2020
  - Fixed a runtime error in a vendored dependency (toml).

63
### 5.0.0 Penny - July 4, 2020
Timothy Crosley's avatar
Timothy Crosley 已提交
64
**Breaking changes:**
65

66
  - isort now requires Python 3.6+ to run but continues to support formatting on ALL versions of python including
67
    Python 2 code.
68
69
  - isort deprecates official support for Python 3.4, removing modules only in this release from known_standard_library:
      - user
70
  - Config files are no longer composed on-top of each-other. Instead the first config file found is used.
Timothy Crosley's avatar
Timothy Crosley 已提交
71
    - Since there is no longer composition negative form settings (such as --dont-skip or it's config file variant `not_skip`) are no longer required and have been removed.
72
  - Two-letter shortened setting names (like `ac` for `atomic`) now require two dashes to avoid ambiguity: `--ac`.
73
  - For consistency with other tools `-v` now is shorthand for verbose and `-V` is shorthand for version. See Issue: #1067.
Timothy Crosley's avatar
Timothy Crosley 已提交
74
  - `length_sort_{section_name}` config usage has been deprecated. Instead `length_sort_sections` list can be used to specify a list of sections that need to be length sorted.
75
76
  - `safety_excludes` and `unsafe` have been deprecated
  - Config now includes as default full set of safety directories defined by safety excludes.
77
78
79
80
  - `--recursive` option has been removed. Directories passed in are now automatically sorted recursive.
  - `--apply` option has been removed as it is the default behaviour.
  - isort now does nothing, beyond giving instructions and exiting status code 0, when ran with no arguments.
    - a new `--interactive` flag has been added to enable the old style behaviour.
81
  - isort now works on contiguous sections of imports, instead of one whole file at a time.
82
  - isort now formats all nested "as" imports in the "from" form. `import x.y as a` becomes `from x import y as a`.
83
  - `keep_direct_and_as_imports` option now defaults to `True`.
Timothy Crosley's avatar
Timothy Crosley 已提交
84
85
86
87
  - `appdirs` is no longer supported. Unless manually specified, config should be project config only.
  - `toml` is now installed as a vendorized module, meaning pyproject.toml based config is always supported.
  - Completely new Python API, old version is removed and no longer accessible.
  - New module placement logic and module fully replaces old finders. Old approach is still available via `--old-finders`.
88

Timothy Crosley's avatar
Timothy Crosley 已提交
89
Internal:
90

91
92
  - isort now utilizes mypy and typing to filter out typing related issues before deployment.
  - isort now utilizes black internally to ensure more consistent formatting.
Timothy Crosley's avatar
Timothy Crosley 已提交
93

94
95
96
- profile support for common project types (black, django, google, etc)

- Much much more. There is some difficulty in fully capturing the extent of changes in this release - just because of how all encompassing the release is. See: [Github Issues](https://github.com/timothycrosley/isort/issues?q=is%3Aissue+is%3Aclosed) for more.
Timothy Crosley's avatar
Timothy Crosley 已提交
97

98
99
100
101
102
103
### 4.3.21 - June 25, 2019 - hot fix release
- Fixed issue #957 - Long aliases and use_parentheses generates invalid syntax

### 4.3.20 - May 14, 2019 - hot fix release
- Fixed issue #948 - Pipe redirection broken on Python2.7

104
105
106
### 4.3.19 - May 12, 2019 - hot fix release
- Fixed issue #942 - correctly handle pyi (Python Template Files) to match `black` output

107
108
109
110
111
112
### 4.3.18 - May 1, 2019 - hot fix release
- Fixed an issue with parsing files that contain unicode characters in Python 2
- Fixed issue #924 - Pulling in pip internals causes depreciation warning
- Fixed issue #938 - Providing a way to filter explicitly passed in files via configuration settings (`--filter-files`)
- Improved interoperability with toml configuration files

113
114
115
### 4.3.17 - April 7, 2019 - hot fix release
- Fixed issue #905 & #919: Import section headers behaving strangely

116
### 4.3.16 - March 23, 2019 - hot fix release
117
- Fixed issue #909 - skip and skip-glob are not enforced when using settings-path.
118
- Fixed issue #907 - appdirs optional requirement does not correctly specify version
119
- Fixed issue #902 - Too broad warning about missing toml package
120
- Fixed issue #778 - remove `user` from known standard library as it's no longer in any supported Python version.
121

Timothy Crosley's avatar
Timothy Crosley 已提交
122
123
### 4.3.15 - March 10, 2019 - hot fix release
- Fixed a regression with handling streaming input from pipes (Issue #895)
124
125
- Fixed handling of \x0c whitespace character (Issue #811)
- Improved CLI documentation
Timothy Crosley's avatar
Timothy Crosley 已提交
126

Timothy Crosley's avatar
Timothy Crosley 已提交
127
128
129
### 4.3.14 - March 9, 2019 - hot fix release
- Fixed a regression with */directory/*.py style patterns

Timothy Crosley's avatar
Timothy Crosley 已提交
130
### 4.3.13 - March 8, 2019 - hot fix release
131
132
- Fixed the inability to accurately determine import section when a mix of conda and virtual environments are used.
- Fixed some output being printed even when --quiet mode is enabled.
133
134
- Fixed issue #890 interoperability with PyCharm by allowing case sensitive non type grouped sorting.
- Fixed issue #889 under some circumstances isort will incorrectly add a new line at the beginning of a file.
Timothy Crosley's avatar
Timothy Crosley 已提交
135
136
- Fixed issue #885 many files not being skipped according to set skip settings.
- Fixed issue #842 streaming encoding improvements.
137

138
139
140
141
### 4.3.12 - March 6, 2019 - hot fix release
- Fix error caused when virtual environment not detected

### 4.3.11 - March 6, 2019 - hot fix release
142
143
144
145
- Fixed issue #876: confused by symlinks pointing to virtualenv gives FIRSTPARTY not THIRDPARTY
- Fixed issue #873: current version skips every file on travis
- Additional caching to reduce performance regression introduced in 4.3.5

146
147
148
149
150
151
152
153
154
155
### 4.3.10 - March 2, 2019 - hot fix release
- Fixed Windows incompatibilities (Issue #835)
- Fixed relative import sorting bug (Issue #417)
- Fixed "no_lines_before" to also be respected from previous empty sections.
- Fixed slow-down introduced by finders mechanism by adding a LRU cache (issue #848)
- Fixed issue #842 default encoding not-set in Python2
- Restored Windows automated testing
- Added Mac automated testing

### 4.3.9 - February 25, 2019 - hot fix release
156
157
- Fixed a bug that led to an incompatibility with black: #831

158
### 4.3.8 - February 25, 2019 - hot fix release
159
160
- Fixed a bug that led to the recursive option not always been available from the command line.

161
162
163
### 4.3.7 - February 25, 2019 - hot fix release
- Expands the finder failsafe to occur on the creation of the finder objects.

164
165
166
### 4.3.6 - February 24, 2019 - hot fix release
- Fixes a fatal error that occurs if a single finder throws an exception. Important as we add more finders that utilize third party libraries.

Timothy Crosley's avatar
Timothy Crosley 已提交
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
### 4.3.5 - February 24, 2019 - last Python 2.7 Maintenance Release

This is the final Python 2.x release of isort, and includes the following major changes:

Potentially Interface Breaking:
- The `-r` option for removing imports has been renamed `-rm` to avoid accidental deletions and confusion with the `-rc` recursive option.
- `__init__.py` has been removed from the default ignore list. The default ignore list is now empty - with all items needing to be explicitly ignored.
- Isort will now by default ignore .tox / venv folders in an effort to be "safe". You can disable this behaviour by setting the "--unsafe" flag, this is separate from any skip or not skip rules you may have in place.
- Isort now allows for files missing closing newlines in whitespace check
- `distutils` support has been removed to simplify setup.py

New:
- Official Python 3.7 Compatibility.
- Support for using requirements files to auto determine third-paty section if pipreqs & requirementslib are installed.
- Added support for using pyproject.toml if toml is installed.
- Added support for XDG_HOME if appdirs is installed.
- An option has been added to enable ignoring trailing comments ('ignore_comments') defaulting to False.
- Added support to enable line length sorting for only specific sections
- Added a `correctly_sorted` property on the SortsImport to enable more intuitive programmatic checking.

Fixes:
- Improved black compatibility.
189
- Isort will now detect files in the CWD as first-party.
Timothy Crosley's avatar
Timothy Crosley 已提交
190
191
192
193
194
195
196
197
198
199
200
201
- Fixed several cases where '-ns' or 'not_skip' was being incorrectly ignored.
- Fixed sorting of relative path imports ('.', '..', '...', etc).
- Fixed bugs caused by a failure to maintain order when loading iterables from config files.
- Correctly handle CPython compiled imports and others that need EXT_SUFFIX to correctly identify.
- Fixed handling of Symbolic Links to follow them when walking the path.
- Fixed handling of relative known_paths.
- Fixed lack of access to all wrap modes from the CLI.
- Fixed handling of FIFO files.
- Fixed a bug that could result in multiple imports being inserted on the same line.


### 4.3.4 - February 12, 2018 - hotfix release
202
203
- Fixed issue #671: isort is corrupting CRLF files

Timothy Crosley's avatar
Timothy Crosley 已提交
204
205
206
### 4.3.3 - Feburary 5, 2018 - hotfix release
- Fixed issue #665: Tabs turned into single spaces

207
208
209
210
### 4.3.2 - Feburary 4, 2018 - hotfix release
- Fixed issue #651: Add imports option is broken
- Fixed issue #662: An error generated by rewriting `.imports` to `. imoprts`

Timothy Crosley's avatar
Timothy Crosley 已提交
211
212
213
214
215
216
### 4.3.1 - Feburary 2, 2018 - hotfix release
- Fixed setup.py errors
- Fixed issue #654: Trailing comma count error
- Fixed issue #650: Wrong error message displayed

### 4.3.0 - January 31, 2018
Timothy Crosley's avatar
Timothy Crosley 已提交
217
- Fixed #557: `force_alphabetical_sort` and `force_sort_within_sections` can now be utilized together without extra new lines
218
219
- Fix case-sensitive path existence check in Mac OS X
- Added `--no-lines-before` for more granular control over section output
Timothy Crosley's avatar
Timothy Crosley 已提交
220
- Fixed #493: Unwanted conversion to Windows line endings
Timothy Crosley's avatar
Timothy Crosley 已提交
221
- Fixed #590: Import `as` mucks with alphabetical sorting
222
- Implemented `--version-number` to retrieve just the version number without the isort logo
223
224
225
- Breaking changes
    - Python 2.7+ only (dropped 2.6) allowing various code simplifications and improvements.

Timothy Crosley's avatar
Timothy Crosley 已提交
226
### 4.2.15 - June 6, 2017 - hotfix release
227
IMPORTANT NOTE: This will be the last release with Python 2.6 support, subsequent releases will be 2.7+ only
Timothy Crosley's avatar
Timothy Crosley 已提交
228
229
230
- Fixed certain one line imports not being successfully wrapped

### 4.2.14 - June 5, 2017 - hotfix release
Timothy Crosley's avatar
Timothy Crosley 已提交
231
232
233
- Fixed #559 & #565: Added missing standard library imports

### 4.2.13 - June 2, 2017 - hotfix release
234
235
236
- Fixed #553: Check only and --diff now work together again

### 4.2.12 - June 1, 2017 - hotfix release
Timothy Crosley's avatar
Timothy Crosley 已提交
237
238
239
- Fixed wheel distribution bug

### 4.2.11 - June 1, 2017 - hotfix release
240
241
242
243
- Fixed #546: Can't select y/n/c after latest update
- Fixed #545: Incorrectly moves __future__ imports above encoding comments

### 4.2.9 - June 1, 2017 - hotfix release
244
245
- Fixed #428: Check only modifies sorting
- Fixed #540: Not correctly identifying stdlib modules
Timothy Crosley's avatar
Timothy Crosley 已提交
246

Timothy Crosley's avatar
Timothy Crosley 已提交
247
### 4.2.8 - May 31, 2017
248
249
250
- Added `--virtual-env` switch command line option
- Added --enforce-whitespace option to go along with --check-only for more exact checks (issue #423)
- Fixed imports with a tailing '\' and no space in-between getting removed (issue #425)
251
252
253
254
255
- Fixed issue #299: long lines occasionally not wrapped
- Fixed issue #432: No longer add import inside class when class starts at top of file after encoding comment
- Fixed issue #440: Added missing `--use-parentheses` option to command line tool and documentation
- Fixed issue #496: import* imports now get successfully identified and reformatted instead of deleted
- Fixed issue #491: Non ending parentheses withing single line comments no longer cause formatting issues
Timothy Crosley's avatar
Timothy Crosley 已提交
256
- Fixed issue #471: Imports that wrap the maximum line length and contain comments on the last line are no longer rendered incorrectly
257
- Fixed issue #436: Force sort within section no longer rearranges comments
258
- Fixed issue #473: Force_to_top and force_sort_within_sections now work together
259
- Fixed issue #484 & #472: Consistent output with imports of same spelling but different case
260
- Fixed issue #433: No longer incorrectly add an extra new-line when comment between imports and function definition
261
- Fixed issue #419: Path specification for skipped paths is not Unix/Windows inter-operable.
262
263
Breaking Changes:
    - Fixed issue #511: All command line options with an underscore, have had the underscore replaced with a dash for consistency. This effects: multi-line, add-import, remove-import, force-adds, --force-single-line-imports, and length-sort.
264
    - Replaced the `--enforce-whitespace` option with `--ignore-whitespace` to restore original behavior of strict whitespace by default
Timothy Crosley's avatar
Timothy Crosley 已提交
265

266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
### 4.2.5
- Fixed an issue that caused modules to inccorectly be matched as thirdparty when they simply had `src` in the leading path, even if they weren't withing $VIRTUALENV/src #414

### 4.2.4
- Fixed an issue that caused module that contained functions before doc strings, to incorrectly place imports
- Fixed regression in how `force_alphabetical_sort` was being interpretted (issue #409)
- Fixed stray print statement printing skipped files (issue #411)
- Added option for forcing imports into a single bucket: `no_sections`
- Added option for new lines between import types (from, straight): `lines_between_sections`

### 4.2.3
- Fixed a large number of priority bugs - bug fix only release

### 4.2.2
- Give an error message when isort is unable to determine where to place a module
- Allow imports to be sorted by module, independent of import_type, when `force_sort_within_sections` option is set
- Fixed an issue that caused Python files with 2 top comments not to be sorted

### 4.2.1
- Hot fix release to fix code error when skipping globs
Patrick Gerken's avatar
Patrick Gerken 已提交
286
287
288

### 4.2.0
- Added option "NOQA" Do not wrap lines, but add a noqa statement at the end
Josh Soref's avatar
Josh Soref 已提交
289
- Added support for running isort recursively, simply with a standalone `isort` command
290
291
292
293
294
295
296
297
298
- Added support to run isort library as a module
- Added compatibility for Python 3.5
- Fixed performance issue (#338) when running on project with lots of skipped directories
- Fixed issue #328: extra new can occasionally occur when using alphabetical-only sort
- Fixed custom sections parsing from config file (unicode string -> list)
- Updated pylama extension to the correct entry point
- Skip files even when file_contents is provided if they are explicitly in skip list
- Removed always showing isort banner, keeping it for when the version is requested, verbose is used, or show_logo setting is set.

299
300
### 4.1.2
- Fixed issue #323: Accidental default configuration change introduced
301

302
303
304
305
### 4.1.1
- Added support for partial file match skips (thanks to @Amwam)
- Added support for --quiet option to only show errors when running isort
- Fixed issue #316: isort added new lines incorrectly when a top-of line comment is present
306

307
308
309
310
311
312
313
314
315
316
317
318
319
### 4.1.0
- Started keeping a log of all changes between releases
- Added the isort logo to the command line interface
- Added example usage gif to README
- Implemented issue #292: skip setting now supports glob patterns
- Implemented issue #271: Add option to sort imports purely alphabetically
- Implemented issue #301: Readme is now natively in RST format, making it easier for Python tooling to pick up
- Implemented pylama isort extension
- Fixed issue #260: # encoding lines at the top of the file are now correctly supported
- Fixed issue #284: Sticky comments above first import are now supported
- Fixed issue #310: Ensure comments don't get duplicated when reformatting imports
- Fixed issue #289: Sections order not being respected
- Fixed issue #296: Made it more clear how to set arguments more then once
320

321
322
### 4.0.0
- Removed all external dependencies