Skip to content

Commit ae65894

Browse files
Apply ruff/isort rule I001
1 parent 7041321 commit ae65894

10 files changed

Lines changed: 30 additions & 27 deletions

File tree

benchmark/benchmark.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import sys
12
from timeit import timeit
2-
import tabulate
3+
34
import prettytable
45
import texttable
5-
import sys
6+
7+
import tabulate
68

79
setup_code = r"""
810
from csv import writer

tabulate/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
"""Pretty-print tabular data."""
22

33
from importlib.metadata import (
4-
version as _version,
54
PackageNotFoundError as _PackageNotFoundError,
5+
version as _version,
66
)
77

88
try:
99
__version__ = _version("tabulate")
1010
except _PackageNotFoundError:
1111
__version__ = "unknown"
1212

13-
import warnings
1413
from collections import namedtuple
1514
from collections.abc import Iterable, Sized
15+
import dataclasses
1616
from decimal import Decimal
17+
from functools import partial, reduce
1718
from html import escape as htmlescape
18-
from itertools import chain, zip_longest as izip_longest
19-
from functools import reduce, partial
2019
import io
21-
import re
20+
from itertools import chain, zip_longest as izip_longest
2221
import math
23-
import textwrap
24-
import dataclasses
22+
import re
2523
import sys
24+
import textwrap
25+
import warnings
2626

2727
try:
2828
import wcwidth # optional wide-character (CJK) support

test/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import pytest # noqa: F401
2-
from pytest import skip, raises # noqa: F401
31
import warnings
42

3+
import pytest # noqa: F401
4+
from pytest import raises, skip # noqa: F401
5+
56

67
def assert_equal(expected, result):
78
print("Expected:\n%r\n" % expected)

test/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""API properties."""
22

3-
from tabulate import tabulate, tabulate_formats, simple_separated_format
4-
from common import skip
3+
from tabulate import simple_separated_format, tabulate, tabulate_formats
54

5+
from common import skip
66

77
try:
8-
from inspect import signature, _empty
8+
from inspect import _empty, signature
99
except ImportError:
1010
signature = None
1111
_empty = None

test/test_cli.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
"""Command-line interface."""
22

33
import os
4-
import sys
5-
6-
74
import subprocess
5+
import sys
86
import tempfile
97

10-
118
from common import assert_equal
129

13-
1410
SAMPLE_SIMPLE_FORMAT = "\n".join(
1511
[
1612
"----- ------ -------------",

test/test_input.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test support of the various forms of tabular data."""
22

3-
from tabulate import tabulate, SEPARATING_LINE
3+
from tabulate import SEPARATING_LINE, tabulate
4+
45
from common import assert_equal, assert_in, raises, skip
56

67
try:

test/test_internal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import tabulate as T
44

5-
from common import assert_equal, skip, rows_to_pipe_table_str, cols_to_pipe_str
5+
from common import assert_equal, cols_to_pipe_str, rows_to_pipe_table_str, skip
66

77

88
def test_multiline_width():

test/test_output.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"""Test output of the various forms of tabular data."""
22

33
from decimal import Decimal
4+
45
from pytest import mark
56

6-
from common import assert_equal, raises, skip, check_warnings
7-
from tabulate import tabulate, simple_separated_format, SEPARATING_LINE
7+
from tabulate import SEPARATING_LINE, simple_separated_format, tabulate
8+
9+
from common import assert_equal, check_warnings, raises, skip
810

911
# _test_table shows
1012
# - coercion of a string to a number,

test/test_regression.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Regression tests."""
22

3-
from tabulate import tabulate, TableFormat, Line, DataRow
3+
from tabulate import DataRow, Line, TableFormat, tabulate
4+
45
from common import assert_equal, skip
56

67

test/test_textwrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Discretely test functionality of our custom TextWrapper"""
22

33
import datetime
4-
5-
from tabulate import _CustomTextWrap as CTW, tabulate, _strip_ansi
64
from textwrap import TextWrapper as OTW
75

8-
from common import skip, assert_equal
6+
from tabulate import _CustomTextWrap as CTW, _strip_ansi, tabulate
7+
8+
from common import assert_equal, skip
99

1010

1111
def test_wrap_multiword_non_wide():

0 commit comments

Comments
 (0)