Skip to content

Commit

Permalink
lint: sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Oct 19, 2024
1 parent c9bb3f5 commit 638672e
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 44 deletions.
8 changes: 5 additions & 3 deletions py3o/template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
documents into real OpenOffice documents with all your data merged-in.
"""

from py3o.template.main import Template # noqa: F401
from py3o.template.main import TextTemplate # noqa: F401
from py3o.template.main import TemplateException # noqa: F401
from py3o.template.main import (
Template, # noqa: F401
TemplateException, # noqa: F401
TextTemplate, # noqa: F401
)
10 changes: 5 additions & 5 deletions py3o/template/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
import copy
import pprint
from textwrap import dedent

from py3o.template.data_struct import (
Py3oBuiltin,
Py3oModule,
Py3oName,
Py3oArray,
Py3oContainer,
Py3oBuiltin,
Py3oCall,
Py3oContainer,
Py3oDummy,
Py3oModule,
Py3oName,
)


# This is used as global context key in the convertor
PY3O_MODULE_KEY = "__py3o_module__"

Expand Down
28 changes: 14 additions & 14 deletions py3o/template/main.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# -*- encoding: utf-8 -*-
import babel.dates
import babel.numbers
from base64 import b64decode
import codecs
from copy import copy
from datetime import datetime
import decimal
import hashlib
from io import BytesIO
import logging
import locale
import logging
import os
import re
import tempfile
import traceback
from uuid import uuid4
import urllib.parse
import warnings
from xml.sax.saxutils import escape
import zipfile
import urllib.parse
import tempfile
from base64 import b64decode
from copy import copy
from datetime import datetime
from io import BytesIO
from uuid import uuid4
from xml.sax.saxutils import escape

import babel.dates
import babel.numbers
import lxml.etree
from PIL import Image
from genshi.core import Markup
from genshi.filters.transform import Transformer
from genshi.template import MarkupTemplate
from genshi.template.text import NewTextTemplate as GenshiTextTemplate
from genshi.filters.transform import Transformer
from genshi.core import Markup
from PIL import Image

log = logging.getLogger(__name__)

Expand Down
18 changes: 9 additions & 9 deletions py3o/template/tests/test_helpers.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# -*- encoding: utf-8 -*-
from py3o.template.data_struct import Py3oDataError
from py3o.template.helpers import Py3oConvertor

import unittest
import os
import unittest
from unittest.mock import Mock

import lxml.etree
import pkg_resources

from xmldiff import main as xmldiff

from py3o.template.main import move_siblings, detect_keep_boundary, Template

from py3o.template.data_struct import Py3oName
from py3o.template.main import _get_secure_filename
from py3o.template.data_struct import Py3oDataError, Py3oName
from py3o.template.helpers import Py3oConvertor
from py3o.template.main import (
Template,
_get_secure_filename,
detect_keep_boundary,
move_siblings,
)


class TestHelpers(unittest.TestCase):
Expand Down
21 changes: 9 additions & 12 deletions py3o/template/tests/test_templates.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
# -*- encoding: utf-8 -*-
import base64
import copy
import datetime
import os
import re
import sys
import traceback
import unittest
import zipfile
import traceback
import copy
import base64
import sys
from io import BytesIO
from unittest.mock import Mock

import lxml.etree
import pkg_resources

from io import BytesIO

import pytest
from genshi.template import TemplateError
from PIL import Image
from xmldiff import main as xmldiff

import pytest

from py3o.template import Template, TextTemplate, TemplateException
from py3o.template import Template, TemplateException, TextTemplate
from py3o.template.main import (
MANIFEST,
XML_NS,
get_image_frames,
_get_secure_filename,
get_image_frames,
get_soft_breaks,
MANIFEST,
)


Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ exclude = ["py3o/template/tests"]
line-length = 79

[tool.ruff.lint]
extend-select = []
extend-select = ["I"]

[tool.ruff.lint.isort]
known-first-party = ["py3o.template"]

0 comments on commit 638672e

Please sign in to comment.