Skip to content

Commit 20425ce

Browse files
authored
Merge branch 'main' into fix-docs
2 parents 8a61d1e + 878824b commit 20425ce

File tree

89 files changed

+2333
-1863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2333
-1863
lines changed

.coveragerc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.flake8

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[flake8]
22
max-line-length = 100
33
# Ignore non PEP 8 compliant rules as suggested by black
4+
# E203: https://github.com/psf/black/blob/3fab5ade71bccf80ae0a5af76729099869adea56/docs/the_black_code_style/current_style.md#slices
45
extend-ignore =
5-
E203, # https://github.com/psf/black/blob/master/docs/the_black_code_style.md#slices
6-
E501
6+
E203,
7+
E501,
8+
B017
79
exclude = _vendored
810
per-file-ignores =
9-
isort/__init__.py:F401
10-
isort/stdlibs/__init__.py:F401
1111
tests/unit/example_crlf_file.py:F401

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
groups:
9+
github-actions:
10+
patterns:
11+
- "*"

.github/workflows/constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pip==22.3.1
1+
pip==23.2
22
virtualenv==20.17.1

.github/workflows/integration.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,16 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ["3.11"]
16+
python-version: ["3.12"]
1717

1818
steps:
19-
- uses: actions/checkout@v2
20-
21-
- name: pip cache
22-
uses: actions/cache@v2
23-
with:
24-
path: ~/.cache/pip
25-
key: integration-pip-${{ hashFiles('**/pyproject.toml') }}
26-
restore-keys: |
27-
integration-pip-
19+
- uses: actions/checkout@v4
2820

2921
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v5
3123
with:
3224
python-version: ${{ matrix.python-version }}
25+
cache: "pip"
3326

3427
- name: Upgrade pip
3528
run: |

.github/workflows/labeler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out the repository
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

1616
- name: Run Labeler
17-
uses: crazy-max/ghaction-github-labeler@v4
17+
uses: crazy-max/ghaction-github-labeler@v5
1818
with:
1919
skip-delete: true

.github/workflows/lint.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,16 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ["3.11"]
16+
python-version: ["3.12"]
1717

1818
steps:
19-
- uses: actions/checkout@v2
20-
21-
- name: pip cache
22-
uses: actions/cache@v2
23-
with:
24-
path: ~/.cache/pip
25-
key: lint-pip-${{ hashFiles('**/pyproject.toml') }}
26-
restore-keys: |
27-
lint-pip-
19+
- uses: actions/checkout@v4
2820

2921
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v5
3123
with:
3224
python-version: ${{ matrix.python-version }}
25+
cache: "pip"
3326

3427
- name: Upgrade pip
3528
run: |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
poetry==1.3.1
1+
poetry==2.0.1

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
if: github.repository_owner == 'PyCQA'
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: release-drafter/release-drafter@v5
14+
- uses: release-drafter/release-drafter@v6
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check out the repository
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 2
1919

2020
- name: Set up Python
21-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2222
with:
23-
python-version: "3.11"
23+
python-version: "3.12"
2424

2525
- name: Upgrade pip
2626
run: |
@@ -65,7 +65,7 @@ jobs:
6565
password: ${{ secrets.PYPI_API_TOKEN }}
6666

6767
- name: Publish the release notes
68-
uses: release-drafter/release-drafter@v5
68+
uses: release-drafter/release-drafter@v6
6969
with:
7070
publish: ${{ steps.check-version.outputs.tag != '' }}
7171
tag: ${{ steps.check-version.outputs.tag }}

.github/workflows/test.yml

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,33 @@
11
---
22
name: Test
33

4-
"on":
4+
on:
55
push:
66
pull_request:
77

88
permissions:
99
contents: read
1010

11+
env:
12+
FORCE_COLOR: 1
13+
1114
jobs:
1215
build:
1316
runs-on: ${{ matrix.os }}
1417
strategy:
1518
fail-fast: false
1619
matrix:
17-
python-version: ["3.8", "3.9", "3.10", "3.11"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1821
os: [ubuntu-latest, macos-latest, windows-latest]
1922

2023
steps:
21-
- uses: actions/checkout@v2
22-
- name: Ubuntu cache
23-
uses: actions/cache@v2
24-
if: startsWith(matrix.os, 'ubuntu')
25-
with:
26-
path: ~/.cache/pip
27-
key:
28-
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
29-
restore-keys: |
30-
${{ matrix.os }}-${{ matrix.python-version }}-
31-
32-
- name: macOS cache
33-
uses: actions/cache@v2
34-
if: startsWith(matrix.os, 'macOS')
35-
with:
36-
path: ~/Library/Caches/pip
37-
key:
38-
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
39-
restore-keys: |
40-
${{ matrix.os }}-${{ matrix.python-version }}-
41-
42-
- name: Windows cache
43-
uses: actions/cache@v2
44-
if: startsWith(matrix.os, 'windows')
45-
with:
46-
path: c:\users\runneradmin\appdata\local\pip\cache
47-
key:
48-
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
49-
restore-keys: |
50-
${{ matrix.os }}-${{ matrix.python-version }}-
24+
- uses: actions/checkout@v4
5125

5226
- name: Set up Python ${{ matrix.python-version }}
53-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v5
5428
with:
5529
python-version: ${{ matrix.python-version }}
30+
cache: "pip"
5631

5732
- name: Upgrade pip
5833
run: |
@@ -61,7 +36,7 @@ jobs:
6136
6237
- name: Install Poetry
6338
run: |
64-
pipx install --pip-args=--constraint=.github/workflows/poetry-constraints.txt poetry
39+
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
6540
poetry --version
6641
6742
- name: Install dependencies
@@ -73,4 +48,4 @@ jobs:
7348

7449
- name: Report Coverage
7550
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
76-
uses: codecov/codecov-action@v1
51+
uses: codecov/codecov-action@v5

.isort.cfg

Lines changed: 0 additions & 5 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
repos:
22
- repo: https://github.com/pycqa/isort
3-
rev: 5.12.0
3+
rev: 5.13.2
44
hooks:
55
- id: isort

.pre-commit-hooks.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
- id: isort
22
name: isort
33
entry: isort
4+
stages: [pre-commit, pre-merge-commit, pre-push, manual]
45
require_serial: true
56
language: python
67
types_or: [cython, pyi, python]
78
args: ['--filter-files']
8-
minimum_pre_commit_version: '2.9.2'
9+
minimum_pre_commit_version: '3.2.0'

CHANGELOG.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,43 @@ Changelog
44
NOTE: isort follows the [semver](https://semver.org/) versioning standard.
55
Find out more about isort's release policy [here](https://pycqa.github.io/isort/docs/major_releases/release_policy).
66

7-
### 5.12.1 [in progress]
7+
### 5.13.2 December 13 2023
8+
9+
- Apply the bracket fix from issue #471 only for use_parentheses=True (#2184) @bp72
10+
- Confine pre-commit to stages (#2213) @davidculley
11+
- Fixed colors extras (#2212) @staticdev
12+
13+
### 5.13.1 December 11 2023
14+
15+
- Fixed integration tests (#2208) @bp72
16+
- Fixed normalizing imports from more than one level of parent modules (issue/2152) (#2191) @bp72
17+
- Remove optional dependencies without extras (#2207) @staticdev
18+
19+
### 5.13.0 December 9 2023
20+
21+
- Cleanup deprecated extras (#2089) @staticdev
822
- Fixed #1989: settings lookup when working in stream based mode
23+
- Fixed 80 line length for wemake linter (#2183) @skatromb
24+
- Add support for Python 3.12 (#2175) @hugovk
25+
- Fixed: add newest version to pre-commit docs (#2190) @AzulGarza
26+
- Fixed assertions in test_git_hook (#2196) @mgorny
27+
- Removed check for include_trailing_comma for the Hanging Indent wrap mode (#2192) @bp72
28+
- Use the standard library tomllib on sufficiently new python (#2202) @eli-schwartz
29+
- Update pre-commit.md version number (#2197) @nicobako
30+
- doc: Update black_compatibility.md (#2177) @JSS95
31+
- Fixed safety sept 2023 (#2178) @staticdev
32+
- docs: fix black profile documentation (#2163) @nijel
33+
- Fixed typo: indended -> indented (#2161) @vadimkerr
34+
- Docs(configuration/options.md): fix missing trailing spaces for hard linebreak (#2157) @JoeyTeng
35+
- Update pre-commit.md (#2148) @godiard
36+
- chore: move configurations to pyproject.toml (#2115) @SauravMaheshkar
37+
- Fixed typo in README (#2112) @stefmolin
38+
- Update version in pre-commit setup to avoid installation issue with poetry (#2103) @stefmolin
39+
- Skip .pytype directory by default. (#2098) @manueljacob
40+
- Fixed a tip block styling in the Config Files section (#2097) @Klavionik
41+
- Do not cache configuration files (#1995) @kaste
42+
- Derive settings_path from --filename (#1992) @kaste
43+
- Fixed year of version 5.12.0 in CHANGELOG.md (#2082) @DjLegolas
944

1045
### 5.12.0 January 28 2023
1146

README.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
------------------------------------------------------------------------
44

55
[![PyPI version](https://badge.fury.io/py/isort.svg)](https://badge.fury.io/py/isort)
6-
[![Test Status](https://github.com/pycqa/isort/workflows/Test/badge.svg?branch=develop)](https://github.com/pycqa/isort/actions?query=workflow%3ATest)
7-
[![Lint Status](https://github.com/pycqa/isort/workflows/Lint/badge.svg?branch=develop)](https://github.com/pycqa/isort/actions?query=workflow%3ALint)
6+
[![Test](https://github.com/PyCQA/isort/actions/workflows/test.yml/badge.svg)](https://github.com/PyCQA/isort/actions/workflows/test.yml)
7+
[![Lint](https://github.com/PyCQA/isort/actions/workflows/lint.yml/badge.svg)](https://github.com/PyCQA/isort/actions/workflows/lint.yml)
88
[![Code coverage Status](https://codecov.io/gh/pycqa/isort/branch/main/graph/badge.svg)](https://codecov.io/gh/pycqa/isort)
99
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://pypi.org/project/isort/)
1010
[![Join the chat at https://gitter.im/timothycrosley/isort](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/timothycrosley/isort?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -19,11 +19,11 @@ _________________
1919

2020
isort your imports, so you don't have to.
2121

22-
isort is a Python utility / library to sort imports alphabetically, and
23-
automatically separated into sections and by type. It provides a command line
22+
isort is a Python utility / library to sort imports alphabetically and
23+
automatically separate into sections and by type. It provides a command line
2424
utility, Python library and [plugins for various
2525
editors](https://github.com/pycqa/isort/wiki/isort-Plugins) to
26-
quickly sort all your imports. It requires Python 3.8+ to run but
26+
quickly sort all your imports. It requires Python 3.9+ to run but
2727
supports formatting Python 2 code too.
2828

2929
- [Try isort now from your browser!](https://pycqa.github.io/isort/docs/quick_start/0.-try.html)
@@ -82,24 +82,6 @@ Installing isort is as simple as:
8282
pip install isort
8383
```
8484

85-
Install isort with requirements.txt support:
86-
87-
```bash
88-
pip install isort[requirements_deprecated_finder]
89-
```
90-
91-
Install isort with Pipfile support:
92-
93-
```bash
94-
pip install isort[pipfile_deprecated_finder]
95-
```
96-
97-
Install isort with both formats support:
98-
99-
```bash
100-
pip install isort[requirements_deprecated_finder,pipfile_deprecated_finder]
101-
```
102-
10385
## Using isort
10486

10587
**From the command line**:

docs/configuration/black_compatibility.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ language: python
3434
python:
3535
- "3.10"
3636
- "3.9"
37-
- "3.8"
3837

3938
install:
4039
- pip install -r requirements-dev.txt
@@ -56,8 +55,8 @@ See [built-in profiles](https://pycqa.github.io/isort/docs/configuration/profile
5655
You can also set the profile directly when integrating isort within pre-commit.
5756

5857
```yaml
59-
- repo: https://github.com/pycqa/isort
60-
rev: 5.6.4
58+
- repo: https://github.com/pycqa/isort
59+
rev: 5.13.2
6160
hooks:
6261
- id: isort
6362
args: ["--profile", "black", "--filter-files"]

docs/configuration/config_files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ directory_root
115115
isort will sort `subdir1/file1` according to the configurations defined in `subdir1/.isort.cfg`, `subdir2/file2` with configurations from `subdir2/pyproject.toml` and `subdir3/file3.py` based on the `setup.cfg` settings.
116116

117117
!!! tip
118-
You can always confirm exactly what config file was used for a file by running isort with the `--verbose` flag.
118+
You can always confirm exactly what config file was used for a file by running isort with the `--verbose` flag.

0 commit comments

Comments
 (0)