From f118eac0f390278cb33817d48707814db6185952 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Thu, 22 Feb 2024 10:41:48 +0100 Subject: [PATCH] Disable import sorting for now. This should take care of #287 until we reimplement the sorting logic. --- bin/tidy-imports | 5 ++++- tests/test_cmdline.py | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/tidy-imports b/bin/tidy-imports index a3b13e08..145c27d6 100755 --- a/bin/tidy-imports +++ b/bin/tidy-imports @@ -158,7 +158,10 @@ def main(): remove_unused=options.remove_unused, add_mandatory=options.add_mandatory, ) - sorted_imports = sort_imports(x) + # TODO: disable sorting until we figure out #287 + # https://github.com/deshaw/pyflyby/issues/287 + # sorted_imports = sort_imports(x) + sorted_imports = x if options.canonicalize: cannonical_imports = canonicalize_imports(sorted_imports, params=options.params) else: diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 4d950b96..52b15929 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -121,7 +121,6 @@ def foo(): foo() + os + sys import a import c - a, c ''').lstrip() assert result == expected_result @@ -139,7 +138,6 @@ def test_tidy_imports_no_add_no_remove_1(): import a import b import c - a, c, os, sys ''').strip() assert result == expected @@ -449,7 +447,6 @@ def test_tidy_imports_query_y_1(): expected = dedent(""" from __future__ import absolute_import, division import x1 - x1 """) assert output == expected @@ -708,6 +705,7 @@ def test_debug_filetype_with_py(): assert expected in output_result.decode() +@pytest.mark.skip(reason='disable sorting for time being until 287 fixed') def test_tidy_imports_sorting(): with tempfile.NamedTemporaryFile(suffix=".py", mode="w+") as f: f.write( @@ -792,7 +790,6 @@ def test_tidy_imports_forward_references(): foo_fp.write(dedent(""" from __future__ import annotations - class A: param1: str param2: B