From 24c297cfe7faeb58aafd11afca242e2292d118d1 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Mon, 23 Jan 2023 06:58:54 +0100 Subject: [PATCH] Remove six dependency --- scour/scour.py | 5 ++--- scour/svg_transform.py | 1 - setup.py | 2 +- test_scour.py | 5 ++--- tox.ini | 1 - 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index 9449f3c..c64d0d2 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -44,20 +44,19 @@ # - if a has only one element in it, collapse the (ensure transform, etc are carried down) - import math import optparse import os import re import sys import time +import urllib.parse +import urllib.request import xml.dom.minidom from xml.dom import Node, NotFoundErr from collections import namedtuple, defaultdict from decimal import Context, Decimal, InvalidOperation, getcontext -import six -from six.moves import urllib from scour.stats import ScourStats from scour.svg_regex import svg_parser diff --git a/scour/svg_transform.py b/scour/svg_transform.py index 1639ae5..7314c44 100644 --- a/scour/svg_transform.py +++ b/scour/svg_transform.py @@ -61,7 +61,6 @@ from decimal import Decimal from functools import partial - # Sentinel. class _EOF: diff --git a/setup.py b/setup.py index 419fb42..252a2fc 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ setup( author_email='codedread@gmail.com', url='https://github.com/scour-project/scour', platforms=('Any'), - install_requires=['six>=1.9.0'], + install_requires=[], packages=find_packages(), zip_safe=True, entry_points={ diff --git a/test_scour.py b/test_scour.py index ebc9911..6a10665 100755 --- a/test_scour.py +++ b/test_scour.py @@ -20,12 +20,11 @@ # limitations under the License. +import io import os import sys import unittest -import six - from scour.scour import (make_well_formed, parse_args, scourString, scourXmlFile, start, run, XML_ENTS_ESCAPE_APOS, XML_ENTS_ESCAPE_QUOT) from scour.svg_regex import svg_parser @@ -2577,7 +2576,7 @@ class CommandLineUsage(unittest.TestCase): # TODO: can we create file objects that behave *exactly* like the original? # this is a mess since we have to ensure compatibility across Python 2 and 3 and it seems impossible # to replicate all the details of 'stdin', 'stdout' and 'stderr' - class InOutBuffer(six.StringIO): + class InOutBuffer(io.StringIO): def write(self, string): try: return super().write(string) diff --git a/tox.ini b/tox.ini index 82420b6..6716ba6 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,6 @@ envlist = [testenv] deps = - six coverage commands =