Skip to content

Commit

Permalink
Issue #85: Remove Python 2.7 support on Amazon-dash v2.0.0 (Remove _c…
Browse files Browse the repository at this point in the history
…ompat file and imports)
  • Loading branch information
Nekmo committed Sep 4, 2018
1 parent 143718c commit a2f75fd
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 43 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ History
v1.2.0 (2018-09-03)
-------------------

- Concurrent options
- Concurrent option
- Improve CPU usage performance
- ``--ignore-perms`` option for Docker
- Docker support
Expand Down
18 changes: 0 additions & 18 deletions amazon_dash/_compat.py

This file was deleted.

2 changes: 1 addition & 1 deletion amazon_dash/confirmations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from requests import RequestException

from amazon_dash.exceptions import InvalidConfig, ConfirmationError
from amazon_dash._compat import JSONDecodeError
from json import JSONDecodeError

class ConfirmationBase(object):
name = None
Expand Down
9 changes: 4 additions & 5 deletions amazon_dash/execute.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import json
import logging

import getpass

import sys

import copy
import subprocess
from json import JSONDecodeError
from urllib.parse import urlparse

from requests import request, RequestException
from amazon_dash._compat import JSONDecodeError
from amazon_dash.exceptions import SecurityException, InvalidConfig, ExecuteError
from ._compat import urlparse, subprocess

EXECUTE_SHELL_PARAM = '-c'
ROOT_USER = 'root'
Expand Down
5 changes: 0 additions & 5 deletions amazon_dash/tests/_compat.py

This file was deleted.

2 changes: 1 addition & 1 deletion amazon_dash/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from ._compat import patch
from unittest.mock import patch
from pyfakefs.fake_filesystem_unittest import Patcher


Expand Down
2 changes: 1 addition & 1 deletion amazon_dash/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import unittest
from ._compat import patch
from unittest.mock import patch

from pyfakefs.fake_filesystem_unittest import Patcher

Expand Down
2 changes: 1 addition & 1 deletion amazon_dash/tests/test_discovery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import print_function
import unittest
from amazon_dash.tests._compat import patch
from unittest.mock import patch

from amazon_dash.discovery import BANNED_DEVICES, pkt_text, AMAZON_DEVICES, mac_id_list, discovery_print, discover
from amazon_dash.listener import Device
Expand Down
8 changes: 3 additions & 5 deletions amazon_dash/tests/test_execute.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import base64
import json
import unittest
from threading import Thread

import subprocess
import requests
import sys
from requests_mock import NoMockAddress
from amazon_dash._compat import subprocess
from amazon_dash.tests._compat import patch as mock_patch, Mock
from unittest.mock import patch as mock_patch, Mock

from amazon_dash.exceptions import SecurityException, InvalidConfig, ExecuteError
from amazon_dash.execute import ExecuteCmd, ExecuteUrl, logger, execute_cmd, get_shell, \
from amazon_dash.execute import ExecuteCmd, ExecuteUrl, execute_cmd, get_shell, \
ExecuteHomeAssistant, ExecuteOpenHab, ExecuteIFTTT, execute_over_ssh
from amazon_dash.tests.base import ExecuteMockBase

Expand Down
3 changes: 1 addition & 2 deletions amazon_dash/tests/test_install.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import unittest
import os
from unittest.mock import patch

from click.testing import CliRunner

from ._compat import patch

from pyfakefs.fake_filesystem_unittest import Patcher

from amazon_dash.install import InstallConfig, IsInstallableException, CONFIG_PATH, IsNecessaryException, \
Expand Down
4 changes: 1 addition & 3 deletions amazon_dash/tests/test_listener.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import threading
import unittest

import os
from unittest.mock import patch

from amazon_dash.confirmations import DisabledConfirmation
from amazon_dash.execute import ExecuteCmd
from amazon_dash.tests._compat import patch

from amazon_dash.exceptions import InvalidConfig, InvalidDevice
from amazon_dash.listener import Listener, Device, last_execution, logger, test_device
from amazon_dash.tests.base import ConfigFileMockBase, ExecuteMockBase
Expand Down

0 comments on commit a2f75fd

Please sign in to comment.