Skip to content

Commit

Permalink
Merge pull request #1042 from sphinx-contrib/update-linters
Browse files Browse the repository at this point in the history
Update linters
  • Loading branch information
jdknight authored Oct 5, 2024
2 parents f9eff7e + ddbe0d3 commit 67d7908
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions sphinxcontrib/confluencebuilder/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from sphinxcontrib.confluencebuilder.util import convert_length
from sphinxcontrib.confluencebuilder.util import extract_length
from sphinxcontrib.confluencebuilder.util import find_env_abspath
import xml.etree.ElementTree as xml_et
import xml.etree.ElementTree as ET


# xml declaration string
Expand All @@ -23,7 +23,7 @@ def svg_initialize():
"""

# prevent ns0 namespace introduction if ever generating svg files
xml_et.register_namespace('', 'http://www.w3.org/2000/svg')
ET.register_namespace('', 'http://www.w3.org/2000/svg')


def confluence_supported_svg(builder, node):
Expand Down Expand Up @@ -77,7 +77,7 @@ def confluence_supported_svg(builder, node):
return

modified = False
svg_root = xml_et.fromstring(svg_data) # noqa: S314
svg_root = ET.fromstring(svg_data) # noqa: S314

# determine (if possible) the svgs desired width/height
svg_height = None
Expand Down Expand Up @@ -179,7 +179,7 @@ def confluence_supported_svg(builder, node):
if height and width:
svg_root.attrib['height'] = str(height)
svg_root.attrib['width'] = str(width)
svg_data = xml_et.tostring(svg_root)
svg_data = ET.tostring(svg_root)
modified = True

# ensure xml declaration exists
Expand Down
4 changes: 2 additions & 2 deletions tests/unit-tests/test_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from tests.lib.parse import parse
from tests.lib.testcase import ConfluenceTestCase
from tests.lib.testcase import setup_builder
import xml.etree.ElementTree as xml_et
import xml.etree.ElementTree as ET


class TestSvg(ConfluenceTestCase):
Expand All @@ -18,7 +18,7 @@ def _extract_svg_size(self, svg_file):
with svg_file.open('rb') as f:
svg_data = f.read()

svg_root = xml_et.fromstring(svg_data) # noqa: S314
svg_root = ET.fromstring(svg_data) # noqa: S314
return int(svg_root.attrib['width']), int(svg_root.attrib['height'])

@setup_builder('confluence')
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ usedevelop = false
[testenv:pylint]
deps =
{[testenv]deps}
pylint: pylint==3.2.5
pylint: pylint==3.3.1
commands =
pylint \
sphinxcontrib \
Expand All @@ -60,7 +60,7 @@ commands =
[testenv:ruff]
deps =
{[testenv]deps}
ruff: ruff==0.5.5
ruff: ruff==0.6.9
setenv =
{[testenv]setenv}
RUFF_CACHE_DIR={toxworkdir}/.ruff_cache
Expand Down

0 comments on commit 67d7908

Please sign in to comment.