Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release 5.11.0 #2028

Merged
merged 10 commits into from Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
@@ -1,3 +1,3 @@
pip==22.3.1
poetry==1.2.2
poetry==1.3.1
virtualenv==20.17.1
3 changes: 0 additions & 3 deletions .github/workflows/integration.yml
Expand Up @@ -32,11 +32,8 @@ jobs:

- name: Install Poetry
run: |
python -m pip install --upgrade pip
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
python -m pip install --upgrade poetry
poetry --version
poetry install

- name: Install dependencies
run: poetry install
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,32 @@ Changelog
NOTE: isort follows the [semver](https://semver.org/) versioning standard.
Find out more about isort's release policy [here](https://pycqa.github.io/isort/docs/major_releases/release_policy).

### 5.11.0 December 12 2022

- Added official support for Python 3.11 (#1996, #2008, #2011) @staticdev
- Dropped support for Python 3.6 (#2019) @barrelful
- Fixed problematic tests (#2021, #2022) @staticdev
- Fixed #1960: Rich compatibility (#1961) @ofek
- Fixed #1945, #1986: Python 4.0 upper bound dependency resolving issues @staticdev
- Fixed Pyodide CDN URL (#1991) @andersk
- Docs: clarify description of use_parentheses (#1941) @mgedmin
- Fixed #1976: `black` compatibility for `.pyi` files @XuehaiPan
- Implemented #1683: magic trailing comma option (#1876) @legau
- Add missing space in unrecoverable exception message (#1933) @andersk
- Fixed #1895: skip-gitignore: use allow list, not deny list @bmalehorn
- Fixed #1917: infinite loop for unmatched parenthesis (#1919) @anirudnits
- Docs: shared profiles (#1896) @matthewhughes934
- Fixed build-backend values in the example plugins (#1892) @mgorny
- Remove reference to jamescurtin/isort-action (#1885) @AndrewLane
- Split long cython import lines (#1931) @davidcollins001
- Update plone profile: copy of `black`, plus three settings. (#1926) @mauritsvanrees
- Fixed #1815, #1862: Add a command-line flag to sort all re-exports (#1863) @parafoxia
- Fixed #1854: `lines_before_imports` appending lines after comments (#1861) @legau
- Remove redundant `multi_line_output = 3` from "Compatibility with black" (#1858) @jdufresne
- Add tox config example (#1856) @umonaca
- Docs: add examples for frozenset and tuple settings (#1822) @sgaist
- Docs: add multiple config documentation (#1850) @anirudnits

### 5.10.1 November 8 2021
- Fixed #1819: Occasional inconsistency with multiple src paths.
- Fixed #1840: skip_file ignored when on the first docstring line
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

18 changes: 1 addition & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions pyproject.toml
Expand Up @@ -3,7 +3,7 @@ line-length = 100

[tool.poetry]
name = "isort"
version = "6.0.0b2"
version = "5.11.0"
description = "A Python utility / library to sort Python imports."
authors = ["Timothy Crosley <timothy.crosley@gmail.com>"]
license = "MIT"
Expand All @@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
Expand All @@ -36,6 +37,9 @@ packages = [
]
include = [
{ path = "tests", format = "sdist" },
{ path = "ACKNOWLEDGEMENTS.md" },
{ path = "CHANGELOG.md" },
{ path = "LICENSE" },
]

[tool.poetry.dependencies]
Expand All @@ -57,13 +61,14 @@ bandit = "^1.6"
black = ">=22.6.0"
coverage = {version = ">=6.5.0", extras = ["toml"]}
#cruft = { version = "^2.2" }
example-isort-formatting-plugin = ">=0.1.0"
example-isort-sorting-plugin = ">=0.1.0"
example-shared-isort-profile = ">=0.1.0"
flake8 = "^3.8.4"
flake8-bugbear = "^19.8"
httpx = "^0.13.3"
hypothesmith = "^0.1.3"
#hypothesis-auto = { version = "^1.0.0" }
hypothesis = "^6.10.1"
ipython = "^7.16"
mypy = "^0.902"
pytest = "^6.0"
Expand All @@ -82,8 +87,6 @@ py = "^1.11.0"
safety = "^2.2.0"
smmap2 = "^3.0.1"
gitdb2 = "^4.0.2"
httpx = "^0.13.3"
hypothesis = "^6.10.1"
libcst = "^0.3.18"
mypy-extensions = "^0.4.3"
toml = "^0.10.2"
Expand Down
3 changes: 2 additions & 1 deletion scripts/lint.sh
@@ -1,11 +1,12 @@
#!/bin/bash
set -euxo pipefail

# TODO: reneable cruft when it takes Python restriction
#poetry run cruft check
poetry run mypy -p isort -p tests
poetry run black --target-version py37 --check .
poetry run isort --profile hug --check --diff isort/ tests/
poetry run isort --profile hug --check --diff example_*/
poetry run flake8 isort/ tests/
poetry run safety check -i 39462 -i 40291 -i 43453 -i 44717 -i 44716 -i 44715 -i 47794 -i 49337 -i 50870 -i 51457 -i 51499
poetry run safety check -i 47794 -i 51457
poetry run bandit -r isort/ -x isort/_vendored
13 changes: 13 additions & 0 deletions tests/integration/test_literal.py
@@ -0,0 +1,13 @@
"""Tests that need installation of other packages."""
# TODO: find a way to install example-isort-formatting-plugin to pass tests
# import isort.literal

# from isort.settings import Config


# def test_value_assignment_list():
# assert isort.literal.assignment("x = ['b', 'a']", "list", "py") == "x = ['a', 'b']"
# assert (
# isort.literal.assignment("x = ['b', 'a']", "list", "py", Config(formatter="example"))
# == 'x = ["a", "b"]'
# )
4 changes: 2 additions & 2 deletions tests/integration/test_setting_combinations.py
Expand Up @@ -977,7 +977,7 @@ def _raise(*a):
virtual_env="",
conda_env="",
ensure_newline_before_comments=False,
directory="/home/abuild/rpmbuild/BUILD/isort-5.5.1",
directory="/home/abuild/rpmbuild/BUILD/isort-5.11.0",
profile="",
honor_noqa=False,
old_finders=False,
Expand Down Expand Up @@ -1842,7 +1842,7 @@ def test_isort_is_idempotent(config: isort.Config, disregard_skip: bool) -> None
virtual_env="",
conda_env="",
ensure_newline_before_comments=False,
directory="/home/abuild/rpmbuild/BUILD/isort-5.5.1",
directory="/home/abuild/rpmbuild/BUILD/isort-5.11.0",
profile="",
honor_noqa=False,
old_finders=False,
Expand Down
188 changes: 188 additions & 0 deletions tests/integration/test_ticketed_features.py
@@ -0,0 +1,188 @@
"""Tests that need installation of other packages."""
# TODO: find a way to install example-isort-formatting-plugin to pass tests
# from io import StringIO

# import pytest

# import isort
# from isort import api, exceptions


# def test_isort_supports_formatting_plugins():
# """Test to ensure isort provides a way to create and share formatting plugins.
# See: https://github.com/pycqa/isort/issues/1353.
# """
# # formatting plugin
# assert isort.code("import a", formatter="example") == "import a\n"
# # non-existent plugin
# with pytest.raises(exceptions.FormattingPluginDoesNotExist):
# assert isort.code("import a", formatter="madeupfake") == "import a\n"


# def test_isort_literals_issue_1358():
# assert (
# isort.code(
# """
# import x
# import a


# # isort: list
# __all__ = ["b", "a", "b"]

# # isort: unique-list
# __all__ = ["b", "a", "b"]

# # isort: tuple
# __all__ = ("b", "a", "b")

# # isort: unique-tuple
# __all__ = ("b", "a", "b")

# # isort: set
# __all__ = {"b", "a", "b"}


# def method():
# # isort: list
# x = ["b", "a"]


# # isort: dict
# y = {"z": "z", "b": "b", "b": "c"}"""
# )
# == """
# import a
# import x

# # isort: list
# __all__ = ['a', 'b', 'b']

# # isort: unique-list
# __all__ = ['a', 'b']

# # isort: tuple
# __all__ = ('a', 'b', 'b')

# # isort: unique-tuple
# __all__ = ('a', 'b')

# # isort: set
# __all__ = {'a', 'b'}


# def method():
# # isort: list
# x = ['a', 'b']


# # isort: dict
# y = {'b': 'c', 'z': 'z'}"""
# )
# assert (
# isort.code(
# """
# import x
# import a


# # isort: list
# __all__ = ["b", "a", "b"]

# # isort: unique-list
# __all__ = ["b", "a", "b"]

# # isort: tuple
# __all__ = ("b", "a", "b")

# # isort: unique-tuple
# __all__ = ("b", "a", "b")

# # isort: set
# __all__ = {"b", "a", "b"}


# def method():
# # isort: list
# x = ["b", "a"]


# # isort: assignments
# d = 1
# b = 2
# a = 3

# # isort: dict
# y = {"z": "z", "b": "b", "b": "c"}""",
# formatter="example",
# )
# == """
# import a
# import x

# # isort: list
# __all__ = ["a", "b", "b"]

# # isort: unique-list
# __all__ = ["a", "b"]

# # isort: tuple
# __all__ = ("a", "b", "b")

# # isort: unique-tuple
# __all__ = ("a", "b")

# # isort: set
# __all__ = {"a", "b"}


# def method():
# # isort: list
# x = ["a", "b"]


# # isort: assignments
# a = 3
# b = 2
# d = 1

# # isort: dict
# y = {"b": "c", "z": "z"}"""
# )
# assert api.sort_stream(
# input_stream=StringIO(
# """
# import a
# import x

# # isort: list
# __all__ = ["b", "a", "b"]

# # isort: unique-list
# __all__ = ["b", "a", "b"]

# # isort: tuple
# __all__ = ("b", "a", "b")

# # isort: unique-tuple
# __all__ = ("b", "a", "b")

# # isort: set
# __all__ = {"b", "a", "b"}


# def method():
# # isort: list
# x = ["b", "a"]


# # isort: assignments
# d = 1
# b = 2
# a = 3

# # isort: dict
# y = {"z": "z", "b": "b", "b": "c"}""",
# ),
# output_stream=StringIO(),
# )
9 changes: 0 additions & 9 deletions tests/unit/test_literal.py
Expand Up @@ -2,7 +2,6 @@

import isort.literal
from isort import exceptions
from isort.settings import Config


def test_value_mismatch():
Expand All @@ -20,14 +19,6 @@ def test_invalid_sort_type():
isort.literal.assignment("x = [1, 2, 3", "tuple-list-not-exist", "py")


def test_value_assignment_list():
assert isort.literal.assignment("x = ['b', 'a']", "list", "py") == "x = ['a', 'b']"
assert (
isort.literal.assignment("x = ['b', 'a']", "list", "py", Config(formatter="example"))
== 'x = ["a", "b"]'
)


def test_value_assignment_assignments():
assert isort.literal.assignment("b = 1\na = 2\n", "assignments", "py") == "a = 2\nb = 1\n"

Expand Down