diff --git a/.gitignore b/.gitignore index b08ff24..d612401 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ nosetests.xml coverage.xml *,cover .hypothesis/ +.pytest_cache/ # Translations *.mo diff --git a/knowit/properties/duration.py b/knowit/properties/duration.py index 9ced880..d9429d1 100644 --- a/knowit/properties/duration.py +++ b/knowit/properties/duration.py @@ -2,7 +2,6 @@ from __future__ import unicode_literals import re - from datetime import timedelta from six import text_type diff --git a/knowit/providers/mediainfo.py b/knowit/providers/mediainfo.py index 4eb04cd..30dd7ee 100644 --- a/knowit/providers/mediainfo.py +++ b/knowit/providers/mediainfo.py @@ -4,7 +4,6 @@ import locale import os import sys - from ctypes import c_size_t, c_void_p, c_wchar_p from logging import NullHandler, getLogger from subprocess import check_output diff --git a/knowit/rules/language.py b/knowit/rules/language.py index b6b6a01..a78e2b1 100644 --- a/knowit/rules/language.py +++ b/knowit/rules/language.py @@ -2,7 +2,6 @@ from __future__ import unicode_literals import re - from logging import NullHandler, getLogger import babelfish diff --git a/setup.py b/setup.py index 086c9fe..14fca5b 100644 --- a/setup.py +++ b/setup.py @@ -22,10 +22,13 @@ def find_version(*file_paths): setup_requirements = ['pytest-runner'] if {'pytest', 'test', 'ptr'}.intersection(sys.argv) else [] -install_requirements = ['babelfish>=0.5.2', 'enzyme>=0.4.1', 'pint>=0.8', 'pymediainfo>=2.1.5', 'PyYAML', +install_requirements = ['babelfish>=0.5.2', 'enzyme>=0.4.1', 'pint>=0.8', 'pymediainfo>=2.1.5', 'PyYAML<4', 'six>=1.9.0'] test_requirements = ['flake8_docstrings', 'flake8-import-order', 'pydocstyle', 'pep8-naming', 'pytest>=2.8', 'pytest-cov', 'pytest-flake8'] +# Remove the following line when `flake8` supports `pycodestyle` >= 2.4.0 +# See https://gitlab.com/pycqa/flake8/issues/415 +test_requirements.append('pycodestyle<2.4.0') if sys.version_info < (3, 3): test_requirements.append('mock') diff --git a/tests/__init__.py b/tests/__init__.py index aff0e74..e6a5861 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -3,10 +3,8 @@ import re import sys - from collections import Mapping from datetime import timedelta - from pkg_resources import resource_exists, resource_isdir, resource_listdir, resource_stream from six import string_types import yaml @@ -17,7 +15,7 @@ try: from mock import Mock -except: +except ImportError: from unittest.mock import Mock