Skip to content

Commit

Permalink
sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Sep 4, 2021
1 parent 5c50ae8 commit cbc3d02
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 93 deletions.
20 changes: 4 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"

[tool.isort]
line_length = 90
combine_as_imports = true
balanced_wrapping = true
lines_after_imports = 2
skip = "venvs/"
not_skip = "__init__.py"
multi_line_output = 5
include_trailing_comma = true

import_heading_stdlib = "built-in"
import_heading_thirdparty = "external"
import_heading_firstparty = "project"
import_heading_localfolder = "app"


[tool.flit.metadata]
module = "svg"
license = "MIT"
Expand All @@ -43,3 +27,7 @@ dev = [
"mypy",
"pytest",
]

[tool.isort]
profile = "django"
lines_after_imports = 2
3 changes: 2 additions & 1 deletion reflect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ._mdn_attr import MDNAttr
from ._lib_element import LibElement
from ._mdn_attr import MDNAttr


__all__ = ['LibElement', 'MDNAttr']
3 changes: 2 additions & 1 deletion reflect/_lib_element.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from dataclasses import dataclass, fields
from functools import cached_property
from typing import List, Set

import svg
from functools import cached_property


@dataclass
Expand Down
7 changes: 4 additions & 3 deletions reflect/_mdn_attr.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import re
from dataclasses import dataclass
from typing import List, Optional, Set
from functools import cached_property
from pathlib import Path
import re
from typing import List, Optional, Set

import yaml
from functools import cached_property


REX_EL = re.compile(r'li>\{\{\s*SVGElement\(["\']([a-zA-Z-]+)["\']\)\s*\}\}\.?</')
Expand Down
1 change: 1 addition & 0 deletions scripts/actualize_deprecated.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path


POJECT_ROOT = Path(__file__).parent.parent.absolute()


Expand Down
76 changes: 10 additions & 66 deletions svg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,18 @@
"""
from . import values
from .elements import (
Animate,
AnimateMotion,
AnimateTransform,
Circle,
ClipPath,
Defs,
Element,
Ellipse,
Line,
LinearGradient,
Marker,
Path,
Pattern,
Polygon,
Polyline,
RadialGradient,
Rect,
Stop,
Text,
TextPath,
Transform,
Use,
SVG,
G,
Desc,
Title,
Symbol,
Image,
Switch,
Style,
TSpan,
ColorProfile,
Mask,
View,
A,
Script,
ForeignObject,
Set,
MPath,
DefinitionSrc,
Metadata,
SVG, A, Animate, AnimateMotion, AnimateTransform, Circle, ClipPath,
ColorProfile, DefinitionSrc, Defs, Desc, Element, Ellipse, ForeignObject,
G, Image, Line, LinearGradient, Marker, Mask, Metadata, MPath, Path,
Pattern, Polygon, Polyline, RadialGradient, Rect, Script, Set, Stop, Style,
Switch, Symbol, Text, TextPath, Title, Transform, TSpan, Use, View,
)
from .filters import (
Filter,
FeGaussianBlur,
FeImage,
FeMerge,
FeMergeNode,
FeOffset,
FeSpecularLighting,
FeTile,
FeTurbulence,
FeBlend,
FeFuncR,
FeFuncG,
FeFuncB,
FeFuncA,
FeFlood,
FeConvolveMatrix,
FeComponentTransfer,
FeComposite,
FeDistantLight,
FePointLight,
FeSpotLight,
FeColorMatrix,
FeDiffuseLighting,
FeDisplacementMap,
FeMorphology,
FeBlend, FeColorMatrix, FeComponentTransfer, FeComposite, FeConvolveMatrix,
FeDiffuseLighting, FeDisplacementMap, FeDistantLight, FeFlood, FeFuncA,
FeFuncB, FeFuncG, FeFuncR, FeGaussianBlur, FeImage, FeMerge, FeMergeNode,
FeMorphology, FeOffset, FePointLight, FeSpecularLighting, FeSpotLight,
FeTile, FeTurbulence, Filter,
)


Expand Down
4 changes: 3 additions & 1 deletion svg/_mixins.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from dataclasses import dataclass
from typing import Optional, Union
from . import values

from typing_extensions import Literal

from . import values


class AttrsMixin:
pass
Expand Down
6 changes: 4 additions & 2 deletions svg/elements.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from dataclasses import dataclass, asdict
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any, ClassVar, Dict, List, Optional, Union

from typing_extensions import Literal

from . import _mixins as m, values
from .transforms import Transform
from typing_extensions import Literal


@dataclass
Expand Down
6 changes: 4 additions & 2 deletions svg/filters.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from dataclasses import dataclass
from typing import Any, List, Optional, Union
from . import _mixins as m, values, elements as e
from .elements import Element

from typing_extensions import Literal

from . import _mixins as m, elements as e, values
from .elements import Element
from .transforms import Transform


Expand Down
2 changes: 1 addition & 1 deletion svg/values.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from decimal import Decimal
from typing import List, Tuple, Union
from dataclasses import dataclass

from typing_extensions import Literal

Expand Down
3 changes: 3 additions & 0 deletions tests/test_attributes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from pathlib import Path

import pytest

import reflect


LIB_ELEMENTS = reflect.LibElement.parse_all()
MDN_ROOT = Path(__file__).parent.parent.parent / 'mdn-source' / 'files' / 'en-us' / 'web' / 'svg'
MDN_ATTRS = reflect.MDNAttr.parse_all(MDN_ROOT)
Expand Down
1 change: 1 addition & 0 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from pathlib import Path

import pytest

import svg
Expand Down

0 comments on commit cbc3d02

Please sign in to comment.