diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 750a3ee..b5c06b3 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: actions/checkout@v3.0.2 - uses: actions/setup-python@v4.2.0 - - uses: psf/black@22.8.0 + - uses: psf/black@23.7.0 with: options: --check --diff --target-version py36 --exclude ^/docs/source/conf\.py$ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c88752..b6569b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 23.7.0 hooks: - id: black language_version: python3 @@ -8,6 +8,6 @@ repos: exclude: '^docs/source/conf\.py$' - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort diff --git a/src/svgutils/templates.py b/src/svgutils/templates.py index e79eb22..5a50783 100644 --- a/src/svgutils/templates.py +++ b/src/svgutils/templates.py @@ -22,7 +22,6 @@ def save(self, fname): SVGFigure.save(self, fname) def _generate_layout(self): - for i, f in enumerate(self.figures): new_element = self._transform(f["root"], self.figures[:i]) self.append(new_element) @@ -50,7 +49,6 @@ def __init__(self, nrows, row_height=None, col_width=None): BaseTemplate.__init__(self) def _transform(self, element, transform_list): - rows = 0 if not transform_list: diff --git a/src/svgutils/transform.py b/src/svgutils/transform.py index 0fde2b2..32687bb 100644 --- a/src/svgutils/transform.py +++ b/src/svgutils/transform.py @@ -21,7 +21,6 @@ class FigureElement(object): """Base class representing single figure element""" def __init__(self, xml_element, defs=None): - self.root = xml_element def moveto(self, x, y, scale_x=1, scale_y=None): diff --git a/tests/test_compose.py b/tests/test_compose.py index 6b52403..d03015b 100644 --- a/tests/test_compose.py +++ b/tests/test_compose.py @@ -33,7 +33,6 @@ def test_embedded_image(): def test_text(): - fig = Figure("5cm", "5cm", Text("lion")) txt = fig.root.find(SVG + "text") diff --git a/tests/test_transform.py b/tests/test_transform.py index 5c3a66c..20ab0f5 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -79,7 +79,6 @@ def test_svg_figure_writes_width_height_and_view_box(): def test_svg_figure__width_height_tostr(): - svg_fig = transform.SVGFigure("400px", "300px") assert b'height="300.0px"' in svg_fig.to_str() assert b'width="400.0px"' in svg_fig.to_str()