Skip to content

Commit

Permalink
sqa: sort imports with isort
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed Dec 24, 2024
1 parent 6b790ac commit 3ab640d
Show file tree
Hide file tree
Showing 1,246 changed files with 1,485 additions and 1,225 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install pytest flake8 black ruff pylint polars pandas
pip install pytest flake8 black ruff isort pylint polars pandas
- name: Test the code style
run: |
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ lint:
@black --check xlsxwriter/ examples/
@pylint xlsxwriter/*.py
@pylint --rcfile=examples/.pylintrc examples/*.py
@isort --check --diff --profile black xlsxwriter/ examples/

tags:
$(Q)rm -f TAGS
Expand Down
1 change: 0 additions & 1 deletion examples/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#
import xlsxwriter


# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook("background.xlsx")
worksheet = workbook.add_worksheet()
Expand Down
1 change: 1 addition & 0 deletions examples/chart_date_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

from datetime import date

import xlsxwriter

workbook = xlsxwriter.Workbook("chart_date_axis.xlsx")
Expand Down
1 change: 1 addition & 0 deletions examples/chart_stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
from datetime import datetime

import xlsxwriter

workbook = xlsxwriter.Workbook("chart_stock.xlsx")
Expand Down
1 change: 1 addition & 0 deletions examples/data_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
from datetime import date, time

import xlsxwriter

workbook = xlsxwriter.Workbook("data_validate.xlsx")
Expand Down
1 change: 1 addition & 0 deletions examples/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
from datetime import datetime

import xlsxwriter

# Create a workbook and add a worksheet.
Expand Down
1 change: 0 additions & 1 deletion examples/defined_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
import xlsxwriter


workbook = xlsxwriter.Workbook("defined_name.xlsx")
worksheet1 = workbook.add_worksheet()
worksheet2 = workbook.add_worksheet()
Expand Down
1 change: 0 additions & 1 deletion examples/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#
import xlsxwriter


# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook("demo.xlsx")
worksheet = workbook.add_worksheet()
Expand Down
2 changes: 2 additions & 0 deletions examples/django_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
# pylint: skip-file

import io

from django.http import HttpResponse
from django.views.generic import View

import xlsxwriter


Expand Down
1 change: 0 additions & 1 deletion examples/embedded_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
import xlsxwriter


# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook("embedded_images.xlsx")
worksheet = workbook.add_worksheet()
Expand Down
2 changes: 1 addition & 1 deletion examples/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#

import http.server
import socketserver
import io
import socketserver

import xlsxwriter

Expand Down
1 change: 0 additions & 1 deletion examples/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#
import xlsxwriter


# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook("images.xlsx")
worksheet = workbook.add_worksheet()
Expand Down
1 change: 0 additions & 1 deletion examples/images_bytesio.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from io import BytesIO
from urllib.request import urlopen


import xlsxwriter

# Create the workbook and add a worksheet.
Expand Down
3 changes: 1 addition & 2 deletions examples/inheritance1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
from xlsxwriter.workbook import Workbook
from xlsxwriter.worksheet import Worksheet
from xlsxwriter.worksheet import convert_cell_args
from xlsxwriter.worksheet import Worksheet, convert_cell_args


class MyWorksheet(Worksheet):
Expand Down
3 changes: 1 addition & 2 deletions examples/inheritance2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
from xlsxwriter.workbook import Workbook
from xlsxwriter.worksheet import Worksheet
from xlsxwriter.worksheet import convert_cell_args
from xlsxwriter.worksheet import Worksheet, convert_cell_args


def excel_string_width(string):
Expand Down
1 change: 0 additions & 1 deletion examples/merge1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#
import xlsxwriter


# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook("merge1.xlsx")
worksheet = workbook.add_worksheet()
Expand Down
1 change: 0 additions & 1 deletion examples/merge_rich_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#
import xlsxwriter


# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook("merge_rich_string.xlsx")
worksheet = workbook.add_worksheet()
Expand Down
1 change: 0 additions & 1 deletion examples/pandas_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import pandas as pd


# Create a Pandas dataframe from some data.
df = pd.DataFrame({"Data": [10, 20, 30, 20, 15, 30, 45]})

Expand Down
1 change: 1 addition & 0 deletions examples/pandas_chart_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

import random

import pandas as pd

# Create some sample data to plot.
Expand Down
1 change: 0 additions & 1 deletion examples/pandas_conditional_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import pandas as pd


# Create a Pandas dataframe from some data.
df = pd.DataFrame({"Data": [10, 20, 30, 20, 15, 30, 45]})

Expand Down
3 changes: 2 additions & 1 deletion examples/pandas_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# Copyright 2013-2024, John McNamara, [email protected]
#

from datetime import datetime, date
from datetime import date, datetime

import pandas as pd

# Create a Pandas dataframe from some datetime data.
Expand Down
1 change: 0 additions & 1 deletion examples/pandas_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import pandas as pd


# Create some Pandas dataframes from some data.
df1 = pd.DataFrame({"Data": [11, 12, 13, 14]})
df2 = pd.DataFrame({"Data": [21, 22, 23, 24]})
Expand Down
1 change: 0 additions & 1 deletion examples/pandas_percentage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import pandas as pd


# Create a Pandas dataframe from some data.
df = pd.DataFrame({"Names": ["Anna", "Arek", "Arun"], "Grade": ["100%", "70%", "85%"]})

Expand Down
1 change: 0 additions & 1 deletion examples/pandas_positioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import pandas as pd


# Create some Pandas dataframes from some data.
df1 = pd.DataFrame({"Data": [11, 12, 13, 14]})
df2 = pd.DataFrame({"Data": [21, 22, 23, 24]})
Expand Down
1 change: 0 additions & 1 deletion examples/pandas_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import pandas as pd


# Create a Pandas dataframe from some data.
df = pd.DataFrame({"Data": [10, 20, 30, 20, 15, 30, 45]})

Expand Down
1 change: 1 addition & 0 deletions examples/polars_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

import polars as pl

import xlsxwriter

df = pl.DataFrame({"Data": [10, 20, 30, 20, 15, 30, 45]})
Expand Down
1 change: 1 addition & 0 deletions examples/polars_format_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

from datetime import date

import polars as pl

# Create a Pandas dataframe with some sample data.
Expand Down
1 change: 1 addition & 0 deletions examples/polars_format_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

from datetime import date

import polars as pl

# Create a Pandas dataframe with some sample data.
Expand Down
1 change: 1 addition & 0 deletions examples/polars_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

import polars as pl

import xlsxwriter

# Create some Polars dataframes from some data.
Expand Down
1 change: 1 addition & 0 deletions examples/polars_positioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

import polars as pl

import xlsxwriter

# Create some Polars dataframes from some data.
Expand Down
1 change: 1 addition & 0 deletions examples/polars_xlsxwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

import polars as pl

import xlsxwriter

with xlsxwriter.Workbook("polars_xlsxwriter.xlsx") as workbook:
Expand Down
1 change: 1 addition & 0 deletions examples/tutorial3.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
from datetime import datetime

import xlsxwriter

# Create a workbook and add a worksheet.
Expand Down
1 change: 1 addition & 0 deletions examples/user_types1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
import uuid

import xlsxwriter


Expand Down
1 change: 1 addition & 0 deletions examples/user_types2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Copyright 2013-2024, John McNamara, [email protected]
#
import math

import xlsxwriter


Expand Down
3 changes: 1 addition & 2 deletions examples/vba_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#

import sys
from zipfile import ZipFile
from zipfile import BadZipFile
from zipfile import BadZipFile, ZipFile


def extract_file(xlsm_zip, filename):
Expand Down
18 changes: 10 additions & 8 deletions xlsxwriter/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
# Copyright 2013-2024, John McNamara, [email protected]
#

import re
import copy
import re
from warnings import warn

from .shape import Shape
from . import xmlwriter
from .utility import _get_rgb_color
from .utility import xl_rowcol_to_cell
from .utility import xl_range_formula
from .utility import _supported_datetime
from .utility import _datetime_to_excel_datetime
from .utility import quote_sheetname
from .shape import Shape
from .utility import (
_datetime_to_excel_datetime,
_get_rgb_color,
_supported_datetime,
quote_sheetname,
xl_range_formula,
xl_rowcol_to_cell,
)


class Chart(xmlwriter.XMLwriter):
Expand Down
1 change: 1 addition & 0 deletions xlsxwriter/chart_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

from warnings import warn

from . import chart


Expand Down
1 change: 1 addition & 0 deletions xlsxwriter/chart_doughnut.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

from warnings import warn

from . import chart_pie


Expand Down
1 change: 1 addition & 0 deletions xlsxwriter/chart_pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

from warnings import warn

from . import chart


Expand Down
1 change: 1 addition & 0 deletions xlsxwriter/chart_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

from warnings import warn

from . import chart


Expand Down
3 changes: 1 addition & 2 deletions xlsxwriter/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
#

from . import xmlwriter
from .utility import _preserve_whitespace
from .utility import xl_rowcol_to_cell
from .utility import _preserve_whitespace, xl_rowcol_to_cell


class Comments(xmlwriter.XMLwriter):
Expand Down
1 change: 1 addition & 0 deletions xlsxwriter/contenttypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

import copy

from . import xmlwriter

# Long namespace strings used in the class.
Expand Down
1 change: 1 addition & 0 deletions xlsxwriter/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# Package imports.
from warnings import warn

from . import xmlwriter


Expand Down
Loading

0 comments on commit 3ab640d

Please sign in to comment.