Skip to content

Commit

Permalink
Refs #401 - Sort imports with isort
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored and claudep committed Oct 22, 2019
1 parent 3197e59 commit a76933e
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 32 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from setuptools import find_packages, setup


install = [
'odfpy',
'openpyxl>=2.4.0',
Expand Down
12 changes: 9 additions & 3 deletions src/tablib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
""" Tablib. """
from pkg_resources import get_distribution, DistributionNotFound
from pkg_resources import DistributionNotFound, get_distribution

from tablib.core import (
Databook, Dataset, detect_format, import_set, import_book,
InvalidDatasetType, InvalidDimensions, UnsupportedFormat
Databook,
Dataset,
InvalidDatasetType,
InvalidDimensions,
UnsupportedFormat,
detect_format,
import_book,
import_set,
)

try:
Expand Down
1 change: 0 additions & 1 deletion src/tablib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from tablib import formats


__title__ = 'tablib'
__author__ = 'Kenneth Reitz'
__license__ = 'MIT'
Expand Down
18 changes: 9 additions & 9 deletions src/tablib/formats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"""

from . import _csv as csv
from . import _json as json
from . import _xls as xls
from . import _yaml as yaml
from . import _tsv as tsv
from . import _html as html
from . import _xlsx as xlsx
from . import _ods as ods
from . import _dbf as dbf
from . import _latex as latex
from . import _df as df
from . import _rst as rst
from . import _html as html
from . import _jira as jira
from . import _json as json
from . import _latex as latex
from . import _ods as ods
from . import _rst as rst
from . import _tsv as tsv
from . import _xls as xls
from . import _xlsx as xlsx
from . import _yaml as yaml

# xlsx before as xls (xlrd) can also read xlsx
available = (json, xlsx, xls, yaml, csv, dbf, tsv, html, jira, latex, ods, df, rst)
1 change: 0 additions & 1 deletion src/tablib/formats/_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import csv
from io import StringIO


title = 'csv'
extensions = ('csv',)

Expand Down
4 changes: 1 addition & 3 deletions src/tablib/formats/_dbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import os
import tempfile

from tablib.packages.dbfpy import dbf
from tablib.packages.dbfpy import dbfnew
from tablib.packages.dbfpy import dbf, dbfnew
from tablib.packages.dbfpy import record as dbfrecord


title = 'dbf'
extensions = ('csv',)

Expand Down
1 change: 0 additions & 1 deletion src/tablib/formats/_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import tablib


title = 'json'
extensions = ('json', 'jsn')

Expand Down
1 change: 0 additions & 1 deletion src/tablib/formats/_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""
import re


title = 'latex'
extensions = ('tex',)

Expand Down
1 change: 1 addition & 0 deletions src/tablib/formats/_ods.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""

from io import BytesIO

from odf import opendocument, style, table, text

title = 'ods'
Expand Down
1 change: 0 additions & 1 deletion src/tablib/formats/_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from statistics import median
from textwrap import TextWrapper


title = 'rst'
extensions = ('rst',)

Expand Down
8 changes: 3 additions & 5 deletions src/tablib/formats/_tsv.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
""" Tablib - TSV (Tab Separated Values) Support.
"""

from tablib.formats._csv import (
export_set as export_set_wrapper,
import_set as import_set_wrapper,
detect as detect_wrapper,
)
from tablib.formats._csv import detect as detect_wrapper
from tablib.formats._csv import export_set as export_set_wrapper
from tablib.formats._csv import import_set as import_set_wrapper

title = 'tsv'
extensions = ('tsv',)
Expand Down
3 changes: 2 additions & 1 deletion src/tablib/formats/_xls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

from io import BytesIO

import tablib
import xlrd
import xlwt

import tablib

title = 'xls'
extensions = ('xls',)

Expand Down
1 change: 1 addition & 0 deletions src/tablib/formats/_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from io import BytesIO

import openpyxl

import tablib

Workbook = openpyxl.workbook.Workbook
Expand Down
3 changes: 2 additions & 1 deletion src/tablib/formats/_yaml.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
""" Tablib - YAML Support.
"""

import tablib
import yaml

import tablib

title = 'yaml'
extensions = ('yaml', 'yml')

Expand Down
3 changes: 1 addition & 2 deletions src/tablib/packages/dbfpy/dbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@

__all__ = ["Dbf"]

from . import header
from . import record
from . import header, record
from .utils import INVALID_VALUE


Expand Down
2 changes: 1 addition & 1 deletion src/tablib/packages/dbfpy/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

__all__ = ["DbfHeader"]

import io
import datetime
import io
import struct
import sys

Expand Down
1 change: 1 addition & 0 deletions src/tablib/packages/dbfpy/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from . import utils


class DbfRecord:
"""DBF record.
Expand Down
1 change: 1 addition & 0 deletions tests/test_tablib.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from uuid import uuid4

from MarkupPy import markup

import tablib
from tablib.core import Row, detect_format
from tablib.formats import _csv as csv_module
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ basepython = python3.7
deps =
flake8
# flake8-black
# flake8-isort
isort
twine
check-manifest
commands =
# flake8 src/tablib tests/
isort --check-only
check-manifest -v
python setup.py sdist
twine check dist/*
Expand Down

0 comments on commit a76933e

Please sign in to comment.