Skip to content

Commit

Permalink
drop remaining six imports
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent committed Dec 28, 2023
1 parent 995a7ae commit 94a5e05
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 42 deletions.
5 changes: 1 addition & 4 deletions freeze/tests/fakeserver.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#!/usr/bin/env python
import json
import multiprocessing
import six
from threading import Thread
from argparse import ArgumentParser
from socketserver import TCPServer
from http.server import SimpleHTTPRequestHandler
from six.moves import urllib

import urllib.parse

class Handler(SimpleHTTPRequestHandler):

Expand Down
3 changes: 1 addition & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ docker
PyYAML
requests
retrying
six
toml

click==7.0
click
tqdm==4.55.1
scrapinghub>=2.4

Expand Down
36 changes: 18 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile
#
certifi==2020.6.20
certifi==2023.11.17
# via requests
chardet==3.0.4
charset-normalizer==3.3.2
# via requests
click==7.0
click==8.1.7
# via -r requirements.in
docker==4.2.2
docker==7.0.0
# via -r requirements.in
idna==2.10
idna==3.6
# via requests
pyyaml==5.4
packaging==23.2
# via docker
pyyaml==6.0.1
# via -r requirements.in
requests==2.24.0
requests==2.31.0
# via
# -r requirements.in
# docker
# scrapinghub
retrying==1.3.3
retrying==1.3.4
# via
# -r requirements.in
# scrapinghub
scrapinghub==2.4.0
# via -r requirements.in
six==1.15.0
six==1.16.0
# via
# -r requirements.in
# docker
# retrying
# scrapinghub
toml==0.10.1
toml==0.10.2
# via -r requirements.in
tqdm==4.55.1
# via -r requirements.in
urllib3==1.25.9
# via requests
websocket-client==0.57.0
# via docker
urllib3==2.1.0
# via
# docker
# requests
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import io
import os
from setuptools import setup, find_packages

Expand Down Expand Up @@ -35,7 +34,6 @@
'retrying',
'requests',
'scrapinghub>=2.3.1',
'six>=1.7.0',
'tqdm==4.55.1',
'toml',
],
Expand Down
3 changes: 0 additions & 3 deletions shub/compat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import six


def to_unicode(text, encoding=None, errors='strict'):
"""Return the unicode representation of `text`.
Expand Down
6 changes: 3 additions & 3 deletions shub/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import os
import warnings
from collections import namedtuple
from urllib.parse import urlparse, urlunparse

import click
import six
import yaml

from shub import DOCS_LINK, CONFIG_DOCS_LINK
Expand Down Expand Up @@ -53,9 +53,9 @@ def __init__(self):
def _check_endpoints(self):
"""Check the endpoints. Send warnings if necessary."""
for endpoint, url in self.endpoints.items():
parsed = six.moves.urllib.parse.urlparse(url)
parsed = urlparse(url)
if parsed.netloc == 'staging.scrapinghub.com':
self.endpoints[endpoint] = six.moves.urllib.parse.urlunparse(
self.endpoints[endpoint] = urlunparse(

Check warning on line 58 in shub/config.py

View check run for this annotation

Codecov / codecov/patch

shub/config.py#L58

Added line #L58 was not covered by tests
parsed._replace(netloc='app.zyte.com')
)
click.echo(
Expand Down
1 change: 0 additions & 1 deletion shub/image/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import click
import docker
import requests
from six import string_types
from urllib.parse import urljoin

from shub.exceptions import ShubException
Expand Down
1 change: 0 additions & 1 deletion shub/image/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import click
import yaml
from tqdm import tqdm
from six import binary_type
import pkg_resources

from shub import config as shub_config
Expand Down
1 change: 0 additions & 1 deletion shub/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from importlib import import_module
from tempfile import NamedTemporaryFile, TemporaryFile
from urllib.parse import urljoin
from six import string_types

import click
import pip
Expand Down
5 changes: 1 addition & 4 deletions tests/image/test_list.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
from unittest import mock

import six
import docker
import pytest
from click.testing import CliRunner
Expand Down Expand Up @@ -33,10 +32,8 @@ def _convert_str(data, to_binary=False):
to corresponding string or binary representation depending on Python
version and boolean `to_binary` parameter.
"""
if to_binary and six.PY3:
if to_binary:
return data.encode('utf-8')
elif not to_binary and six.PY2:
return data.decode('utf-8')
return data


Expand Down
4 changes: 2 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import textwrap
import unittest
from unittest import mock
from io import StringIO

import six
import yaml
from click.testing import CliRunner
from yaml import CLoader as Loader
Expand Down Expand Up @@ -87,7 +87,7 @@ class ShubConfigTest(unittest.TestCase):

def _get_conf_with_yml(self, yml):
conf = ShubConfig()
conf.load(six.StringIO(textwrap.dedent(yml)))
conf.load(StringIO(textwrap.dedent(yml)))
return conf

def setUp(self):
Expand Down
1 change: 0 additions & 1 deletion tests/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import requests
from click.testing import CliRunner
from six import string_types

from shub import deploy
from shub.exceptions import (
Expand Down

0 comments on commit 94a5e05

Please sign in to comment.