Skip to content

Commit 6da9dc4

Browse files
authored
Merge branch 'main' into main
2 parents 4558bfb + 788b27d commit 6da9dc4

File tree

16 files changed

+268
-194
lines changed

16 files changed

+268
-194
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
poetry==1.8.5
1+
poetry==2.0.1

example_isort_formatting_plugin/poetry.lock

+61-111
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example_isort_formatting_plugin/pyproject.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ license = "MIT"
99
example = "example_isort_formatting_plugin:black_format_import_section"
1010

1111
[tool.poetry.dependencies]
12-
python = ">=3.7.0"
13-
isort = ">=5.11.0"
14-
black = ">=22.8.0"
12+
python = ">=3.10.0"
13+
isort = ">=5.12.0"
14+
black = ">=24.3.0"
1515

16-
[tool.poetry.dev-dependencies]
16+
[tool.poetry.group.dev.dependencies]
1717

1818
[build-system]
1919
requires = ["poetry-core>=1.0.0"]

example_isort_sorting_plugin/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ license = "MIT"
99
natural_plus = "example_isort_sorting_plugin:natural_plus"
1010

1111
[tool.poetry.dependencies]
12-
python = ">=3.7"
12+
python = ">=3.9"
1313
natsort = ">=7.1.1"
1414

15-
[tool.poetry.dev-dependencies]
15+
[tool.poetry.group.dev.dependencies]
1616

1717
[build-system]
1818
requires = ["poetry-core>=1.0.0"]

example_shared_isort_profile/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ license = "MIT"
99
example = "example_shared_isort_profile:PROFILE"
1010

1111
[tool.poetry.dependencies]
12-
python = ">=3.7"
12+
python = ">=3.9"
1313

14-
[tool.poetry.dev-dependencies]
14+
[tool.poetry.group.dev.dependencies]
1515

1616
[build-system]
1717
requires = ["poetry-core>=1.0.0"]

isort/api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def sort_stream(
193193
if config.atomic:
194194
try:
195195
file_content = input_stream.read()
196-
compile(file_content, content_source, "exec", 0, 1)
196+
compile(file_content, content_source, "exec", flags=0, dont_inherit=True)
197197
except SyntaxError:
198198
if extension not in CYTHON_EXTENSIONS:
199199
raise ExistingSyntaxErrors(content_source)
@@ -220,7 +220,7 @@ def sort_stream(
220220
if config.atomic:
221221
_internal_output.seek(0)
222222
try:
223-
compile(_internal_output.read(), content_source, "exec", 0, 1)
223+
compile(_internal_output.read(), content_source, "exec", flags=0, dont_inherit=True)
224224
_internal_output.seek(0)
225225
except SyntaxError: # pragma: no cover
226226
if extension not in CYTHON_EXTENSIONS:

isort/deprecated/finders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from pip_api import parse_requirements # type: ignore
3030

3131
except ImportError:
32-
parse_requirements = None
32+
parse_requirements = None # type: ignore[assignment]
3333

3434

3535
@contextmanager

isort/literal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def wrap(
8686

8787
@register_type("dict", dict)
8888
def _dict(value: Dict[Any, Any], printer: ISortPrettyPrinter) -> str:
89-
return printer.pformat(dict(sorted(value.items(), key=lambda item: item[1]))) # type: ignore
89+
return printer.pformat(dict(sorted(value.items(), key=lambda item: item[1])))
9090

9191

9292
@register_type("list", list)

isort/settings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ def _get_config_data(file_path: str, sections: Tuple[str, ...]) -> Dict[str, Any
858858
and config_key.endswith("}")
859859
and extension
860860
in map(
861-
lambda text: text.strip(), config_key[len("*.{") : -1].split(",") # type: ignore # noqa
861+
lambda text: text.strip(),
862+
config_key[len("*.{") : -1].split(","), # noqa
862863
)
863864
):
864865
settings.update(config.items(config_key))

isort/sorting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def naturally(
117117
else:
118118

119119
def key_callback(text: str) -> List[Any]:
120-
return _natural_keys(key(text)) # type: ignore
120+
return _natural_keys(key(text))
121121

122122
return sorted(to_sort, key=key_callback, reverse=reverse)
123123

poetry.lock

+183-60
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ setuptools = {version = "*", optional = true}
4848
colors = ["colorama"]
4949
plugins = ["setuptools"]
5050

51-
[tool.poetry.dev-dependencies]
51+
[tool.poetry.group.dev.dependencies]
5252
bandit = ">=1.7.7"
5353
black = ">=24.3.0"
5454
colorama = ">=0.4.6"
@@ -57,12 +57,12 @@ cruft = ">=2.12.0"
5757
example-isort-sorting-plugin = ">=0.1.0"
5858
example-shared-isort-profile = ">=0.1.0"
5959
flake8 = ">=3.8.4"
60-
flake8-bugbear = ">=22.12.6,<23.0.0"
60+
flake8-bugbear = ">=22.12.12"
6161
httpx = ">=0.13.3"
6262
hypothesis = ">=6.10.1"
6363
hypothesmith = ">=0.1.3"
6464
libcst = ">=0.3.18"
65-
mypy = ">=0.902,<1.0.0"
65+
mypy = ">=1.14.1"
6666
mypy-extensions = ">=0.4.3"
6767
pep8-naming = ">=0.8.2"
6868
pip = ">=21.1.1"

tests/integration/test_hypothesmith.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def configs(**force_strategies: st.SearchStrategy) -> st.SearchStrategy:
6666
"py_version": st.sampled_from(("auto",) + isort.settings.VALID_PY_TARGETS),
6767
}
6868
kwargs = {**inferred_kwargs, **specific, **force_strategies}
69-
return st.fixed_dictionaries({}, optional=kwargs).map(_as_config) # type: ignore
69+
return st.fixed_dictionaries({}, optional=kwargs).map(_as_config)
7070

7171

7272
st.register_type_strategy(isort.Config, configs())

tests/integration/test_setting_combinations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def configs() -> st.SearchStrategy:
6161
"py_version": st.sampled_from(("auto",) + isort.settings.VALID_PY_TARGETS),
6262
}
6363
kwargs = {**inferred_kwargs, **specific}
64-
return st.fixed_dictionaries({}, optional=kwargs).map(_as_config) # type:ignore
64+
return st.fixed_dictionaries({}, optional=kwargs).map(_as_config)
6565

6666

6767
st.register_type_strategy(isort.Config, configs())

tests/unit/test_isort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5551,7 +5551,7 @@ def test_find_imports_in_stream() -> None:
55515551
"""Ensure that find_imports_in_stream can work with nonseekable streams like STDOUT"""
55525552

55535553
class NonSeekableTestStream(StringIO):
5554-
def seek(self, position):
5554+
def seek(self, offset: int, whence: int = os.SEEK_SET, /) -> int:
55555555
raise OSError("Stream is not seekable")
55565556

55575557
def seekable(self):

tests/unit/test_setuptools_command.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_isort_command_smoke(src_dir):
1212
command.finalize_options()
1313
try:
1414
command.run()
15-
except BaseException:
15+
except SystemExit:
1616
pass
1717

1818
command.distribution.package_dir = {"": "isort"}
@@ -27,5 +27,5 @@ def test_isort_command_smoke(src_dir):
2727
command.finalize_options()
2828
try:
2929
command.run()
30-
except BaseException:
30+
except SystemExit:
3131
pass

0 commit comments

Comments
 (0)