Sync from SUSE:SLFO:Main python-isort revision 0953a77622976aff07937a24f0e1ea4f

This commit is contained in:
2025-05-13 16:55:34 +02:00
parent f566e97ffe
commit c4bea05d4b
5 changed files with 173 additions and 40 deletions

BIN
isort-5.12.0-gh.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
isort-5.13.2-gh.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,3 +1,64 @@
-------------------------------------------------------------------
Fri May 2 08:59:30 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Raise suse_version to disable pymama tests to <= 1600
-------------------------------------------------------------------
Thu Oct 24 11:20:33 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Remove not needed build dependencies
-------------------------------------------------------------------
Fri Aug 30 02:57:29 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-pytest-8.patch:
* Do not use the anti-pattern of pytest.warns(None).
-------------------------------------------------------------------
Tue Feb 27 08:59:27 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Disable black output test: gh#PyCQA/isort#2233
-------------------------------------------------------------------
Mon Jan 15 17:50:47 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>
- Disable pylama tests in SLE since pylama adds too many
dependencies.
-------------------------------------------------------------------
Sun Dec 17 02:10:01 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 5.13.2:
* Apply the bracket fix from issue #471 only for
use_parentheses=True
* Confine pre-commit to stages
* Fixed colors extras
* Fixed integration tests
* Fixed normalizing imports from more than one level of parent
modules
* Remove optional dependencies without extras
* Cleanup deprecated extras
* Fixed #1989: settings lookup when working in stream based
mode
* Fixed 80 line length for wemake linter
* Add support for Python 3.12
* Fixed assertions in test_git_hook
* Removed check for include_trailing_comma for the Hanging
Indent wrap mode
* Use the standard library tomllib on sufficiently new python
* Fixed safety sept 2023
* chore: move configurations to pyproject.toml (#2115)
* Fixed typo in README
* Update version in pre-commit setup to avoid installation
issue with poetry
* Skip .pytype directory by default.
* Fixed a tip block styling in the Config Files section (#2097)
-------------------------------------------------------------------
Wed Aug 30 08:21:33 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Skip failing test with hypothesis gh#PyCQA/isort#2171
-------------------------------------------------------------------
Tue May 9 04:57:51 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
@@ -209,7 +270,7 @@ Sun Mar 21 18:33:47 UTC 2021 - Ben Greiner <code@bnavigator.de>
top to avoid overriding explicitly defined imports.
* Documented #1685: Skip doesn't support plain directory names,
but skip_glob does.
-------------------------------------------------------------------
Fri Jan 29 19:59:54 UTC 2021 - Benjamin Greiner <code@bnavigator.de>
@@ -251,23 +312,23 @@ Fri Dec 11 23:19:12 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
Tue Oct 13 18:28:28 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to Version 5.6.4
* Fixed #1556: Empty line added between imports that should be
* Fixed #1556: Empty line added between imports that should be
skipped.
- Version 5.6.3
* Improved packaging of test files alongside source distribution
* Improved packaging of test files alongside source distribution
(see: https://github.com/PyCQA/isort/pull/1555).
- Version 5.6.2
* Fixed #1548: On rare occasions an unecessary empty line can be
* Fixed #1548: On rare occasions an unecessary empty line can be
added when an import is marked as skipped.
* Fixed #1542: Bug in VERTICAL_PREFIX_FROM_MODULE_IMPORT wrap
* Fixed #1542: Bug in VERTICAL_PREFIX_FROM_MODULE_IMPORT wrap
mode.
* Fixed #1552: Pylama test dependent on source layout.
* Goal Zero: (Tickets related to aspirational goal of achieving 0
* Goal Zero: (Tickets related to aspirational goal of achieving 0
regressions for remaining 5.0.0 lifespan):
* Zope added to integration test suite
* Additional testing of CLI (simulate unseekable streams)
- now only requires poetry.core as PEP517 backend
-------------------------------------------------------------------
Fri Oct 9 16:47:11 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
@@ -277,44 +338,44 @@ Fri Oct 9 16:47:11 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
Thu Oct 8 15:56:53 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to 5.6.1
* Fixed #1546: Unstable (non-idempotent) behavior with certain
* Fixed #1546: Unstable (non-idempotent) behavior with certain
src trees.
- Changelog for 5.6.0
* Implemented #1433: Provide helpful feedback in case a custom
* Implemented #1433: Provide helpful feedback in case a custom
config file is specified without a configuration.
* Implemented #1494: Default to sorting imports within .pxd
* Implemented #1494: Default to sorting imports within .pxd
files.
* Implemented #1502: Improved float-to-top behavior when there
* Implemented #1502: Improved float-to-top behavior when there
is an existing import section present at top-of-file.
* Implemented #1511: Support for easily seeing all files isort
* Implemented #1511: Support for easily seeing all files isort
will be ran against using isort . --show-files.
* Implemented #1487: Improved handling of encoding errors.
* Improved handling of unsupported configuration option errors
(see #1475).
* Fixed #1463: Better interactive documentation for future
* Improved handling of unsupported configuration option errors
(see #1475).
* Fixed #1463: Better interactive documentation for future
option.
* Fixed #1461: Quiet config option not respected by file API in
* Fixed #1461: Quiet config option not respected by file API in
some circumstances.
* Fixed #1482: pylama integration is not working correctly out-
of-the-box.
* Fixed #1492: --check does not work with stdin source.
* Fixed #1499: isort gets confused by single line, multi-line
* Fixed #1499: isort gets confused by single line, multi-line
style comments when using float-to-top.
* Fixed #1525: Some warnings can't be disabled with --quiet.
* Fixed #1523: in rare cases isort can ignore direct from import
* Fixed #1523: in rare cases isort can ignore direct from import
if as import is also on same line.
+ Potentially breaking changes:
* Implemented #1540: Officially support Python 3.9 stdlib
* Implemented #1540: Officially support Python 3.9 stdlib
imports by default.
* Fixed #1443: Incorrect third vs first party categorization -
* Fixed #1443: Incorrect third vs first party categorization -
namespace packages.
* Fixed #1486: "Google" profile is not quite Google style.
* Fixed "PyCharm" profile to always add 2 lines to be consistent
* Fixed "PyCharm" profile to always add 2 lines to be consistent
with what PyCharm "Optimize Imports" does.
+ Goal Zero:
* Implemented #1472: Full testing of stdin CLI Options
* Added additional branch coverage.
* More projects added to integration test suite.
* More projects added to integration test suite.
- Changelog for 5.5.5
* Fixed #1539: in extremely rare cases isort 5.5.4 introduces
syntax error by removing closing paren.
@@ -323,7 +384,7 @@ Thu Oct 8 15:56:53 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
multiline strings after a yield statement.
* Fixed #1505: Support case where known_SECTION points to a
section not listed in sections.
- Use upstream's way of PIP with Poetry PEP517 backend to install
- Use upstream's way of PIP with Poetry PEP517 backend to install
the package so we can use Github archive only
- A Poetry update required to modify the examples installation for
testing
@@ -335,8 +396,8 @@ Mon Sep 21 11:48:02 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to 5.5.3
* Fixed #1488: in rare cases isort can mangle yield from or raise
from statements.
- Version 5.5.2
* Fixed #1469: --diff option is ignored when input is from stdin.
- Version 5.5.2
* Fixed #1469: --diff option is ignored when input is from stdin.
-------------------------------------------------------------------
Tue Sep 8 14:08:11 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
@@ -363,7 +424,7 @@ Tue Sep 8 10:45:42 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
* Fixed #1399: --skip can error in the case of projects that
contain recursive symlinks.
* Fixed #1389: ensure_newline_before_comments doesn't work if
comment is at top of section and sections don't have lines
comment is at top of section and sections don't have lines
between them.
* Fixed #1396: comments in imports with ";" can keep isort from
recognizing import line.
@@ -414,7 +475,7 @@ Wed Aug 19 04:17:27 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
* Implemented #1373: support for length sort only of direct (AKA
straight) imports.
* Fixed #1321: --combine-as loses # noqa.
* Fixed #1375: --dont-order-by-type CLI broken.
* Fixed #1375: --dont-order-by-type CLI broken.
-------------------------------------------------------------------
Sat Aug 8 12:21:14 UTC 2020 - Sebastian Wagner <sebix+novell.com@sebix.at>
@@ -427,13 +488,13 @@ Sat Aug 8 12:21:14 UTC 2020 - Sebastian Wagner <sebix+novell.com@sebix.at>
-------------------------------------------------------------------
Thu Aug 6 13:53:40 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- do not test hypothesmith integration because we lack python-libcst
- do not test hypothesmith integration because we lack python-libcst
-------------------------------------------------------------------
Thu Aug 6 09:21:42 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to 5.3.0
* Implemented ability to treat all or select comments as code
* Implemented ability to treat all or select comments as code
(issue #1357)
* Implemented ability to use different configs for different file
extensions (issue #1162)
@@ -471,7 +532,7 @@ Wed Jul 29 10:39:20 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
* Improved relative path detection for skip config usage.
* Added recursive symbolic link protection.
* Implemented #1177: Support for color output using --color.
* Implemented recursive symlink detection support.
* Implemented recursive symlink detection support.
-------------------------------------------------------------------
Tue Jul 28 20:09:25 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
#
# spec file
# spec file for package python-isort
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,22 +25,30 @@
%bcond_with test
%endif
%if 0%{?suse_version} <= 1600
%bcond_with pylama
%else
%bcond_without pylama
%endif
%{?sle15_python_module_pythons}
Name: python-isort%{psuffix}
Version: 5.12.0
Version: 5.13.2
Release: 0
Summary: A Python utility / library to sort Python imports
License: MIT
URL: https://pycqa.github.io/isort/
# tests and example projects are not packaged for PyPI, get them from Github
Source: https://github.com/PyCQA/isort/archive/%{version}.tar.gz#/isort-%{version}-gh.tar.gz
# PATCH-FIX-UPSTREAM gh#PyCQA/isort#2235
Patch0: support-pytest-8.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module poetry-core}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires(postun): update-alternatives
Recommends: python-colorama >= 0.4.3
Recommends: python-pip-api
Recommends: python-pip-shims >= 0.5.2
@@ -52,13 +60,14 @@ BuildArch: noarch
BuildRequires: %{python_module black}
BuildRequires: %{python_module colorama >= 0.4.3}
BuildRequires: %{python_module hypothesmith}
BuildRequires: %{python_module isort == %{version}}
BuildRequires: %{python_module libcst}
BuildRequires: %{python_module natsort}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pip-api}
BuildRequires: %{python_module pipreqs}
BuildRequires: %{python_module poetry}
%if %{with pylama}
BuildRequires: %{python_module pylama}
%endif
BuildRequires: %{python_module pytest > 6.0}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module toml >= 0.10.2}
@@ -76,9 +85,13 @@ imports. It requires Python 3.8+ to run but supports formatting Python 2 code
too.
%prep
%setup -q -n isort-%{version}
%autosetup -p1 -n isort-%{version}
chmod -x LICENSE
%if %{without pylama}
sed -i '/import isort.pylama_isort/d' tests/unit/test_importable.py
%endif
echo "
# increase test deadline for slow obs executions
import hypothesis
@@ -107,13 +120,20 @@ hypothesis.settings.register_profile(
ignoretests="--ignore tests/integration/test_projects_using_isort.py"
# don't run benchmarks
ignoretests+=" --ignore tests/benchmark"
%if %{without pylama}
ignoretests+=" --ignore tests/unit/test_pylama_isort.py"
%endif
# test_setting_combinations.py::test_isort_is_idempotent
# is flaky https://github.com/PyCQA/isort/issues/1466
donttest="(test_setting_combinations and test_isort_is_idempotent)"
# https://github.com/PyCQA/isort/issues/2171
donttest+=" or (test_hypothesmith and test_isort_is_idempotent)"
# The package python-requirementslib is not available anymore.
# It's a deprecated finder for isort so we drop it
# https://github.com/sarugaku/requirementslib/issues/288
donttest+=" or (test_deprecated_finders and test_pipfile_finder)"
# https://github.com/PyCQA/isort/issues/2233
donttest+=" or test_black_pyi_file"
ORIGPATH=$PATH
%{python_expand # install isort and required example projects into custom root

52
support-pytest-8.patch Normal file
View File

@@ -0,0 +1,52 @@
From 9c0b6272bfb1fd41298dd0fa9d072367bd79cc1b Mon Sep 17 00:00:00 2001
From: Stanislav Levin <slev@altlinux.org>
Date: Thu, 15 Feb 2024 17:42:59 +0300
Subject: [PATCH] Drop deprecated pytest.warns(None)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With Pytest 7:
https://docs.pytest.org/en/stable/changelog.html#pytest-7-0-0rc1-2021-12-06
> #8645: pytest.warns(None) is now deprecated because many people used
it to mean “this code does not emit warnings”, but it actually had the
effect of checking that the code emits at least one warning of any
type-like pytest.warns() or pytest.warns(Warning)
With Pytest 8 it's the error.
Changed according to the documentation:
https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests
Fixes: https://github.com/PyCQA/isort/issues/2234
Signed-off-by: Stanislav Levin <slev@altlinux.org>
---
tests/unit/test_ticketed_features.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/unit/test_ticketed_features.py b/tests/unit/test_ticketed_features.py
index 32eeb709..bc847ed5 100644
--- a/tests/unit/test_ticketed_features.py
+++ b/tests/unit/test_ticketed_features.py
@@ -3,6 +3,7 @@
"""
from functools import partial
from io import StringIO
+import warnings
import pytest
@@ -615,9 +616,9 @@ def test_isort_should_warn_on_empty_custom_config_issue_1433(tmpdir):
quiet = true
"""
)
- with pytest.warns(None) as warning: # type: ignore
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
assert Config(settings_file=str(settings_file)).quiet
- assert not warning
def test_float_to_top_should_respect_existing_newlines_between_imports_issue_1502():