diff --git a/.travis.yml b/.travis.yml index 25e60c2..191be87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,8 @@ matrix: - pip install .[testing] script: - pytest --cov-report term-missing - - mypy . + # In recent versions of setuptools, pip install . creates a "build" directory + - mypy . --exclude=build - stage: build python: '3.8' install: @@ -41,7 +42,8 @@ matrix: - pip install .[testing] script: - pytest --cov-report term-missing - - mypy . + # In recent versions of setuptools, pip install . creates a "build" directory + - mypy . --exclude=build - stage: deploy if: tag =~ ^[0-9]+\.[0-9]+\.[0-9]+ python: '3.6' diff --git a/setup.py b/setup.py index de680ec..c7370b9 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def readme(): install_requires = [ - 'attrs>=17.4,<20', + 'attrs>=17.4,<22', 'conformity>=1.26.9,!=1.27.0,<2.0', 'enum34;python_version<"3.4"', 'six', @@ -43,6 +43,7 @@ def readme(): 'pytest-runner', 'mock', 'more-itertools~=5.0', # We must pin this, because 6.0 requires Python 3. + 'importlib-metadata', # We need to explicitly install it to avoid incompatibilities with setuptools ] + mypy_require diff --git a/tests/unit/recorders/test_default.py b/tests/unit/recorders/test_default.py index 13f84db..189486c 100644 --- a/tests/unit/recorders/test_default.py +++ b/tests/unit/recorders/test_default.py @@ -3,6 +3,7 @@ unicode_literals, ) +import datetime import time from typing import ( Any, @@ -578,11 +579,11 @@ def se(): mock_publish.reset_mock() recorder.unpublished_metrics_count = 1 - frozen_time.tick(9) + frozen_time.tick(datetime.timedelta(seconds=9)) recorder.publish_if_full_or_old() assert mock_publish.call_count == 0 - frozen_time.tick(1) + frozen_time.tick(datetime.timedelta(seconds=1)) recorder.publish_if_full_or_old() mock_publish.assert_called_once_with() mock_publish.reset_mock() @@ -591,11 +592,11 @@ def se(): recorder.publish_if_full_or_old() assert mock_publish.call_count == 0 - frozen_time.tick(13) + frozen_time.tick(datetime.timedelta(seconds=13)) recorder.publish_if_full_or_old(max_age=14) assert mock_publish.call_count == 0 - frozen_time.tick(1) + frozen_time.tick(datetime.timedelta(seconds=1)) recorder.publish_if_full_or_old() mock_publish.assert_called_once_with() mock_publish.reset_mock() @@ -620,11 +621,11 @@ def se(): recorder.throttled_publish_all() assert mock_publish.call_count == 0 - frozen_time.tick(9) + frozen_time.tick(datetime.timedelta(seconds=9)) recorder.throttled_publish_all() assert mock_publish.call_count == 0 - frozen_time.tick(1) + frozen_time.tick(datetime.timedelta(seconds=1)) recorder.throttled_publish_all() mock_publish.assert_called_once_with() mock_publish.reset_mock() @@ -633,11 +634,11 @@ def se(): recorder.throttled_publish_all() assert mock_publish.call_count == 0 - frozen_time.tick(13) + frozen_time.tick(datetime.timedelta(seconds=13)) recorder.throttled_publish_all(14) assert mock_publish.call_count == 0 - frozen_time.tick(1) + frozen_time.tick(datetime.timedelta(seconds=1)) recorder.throttled_publish_all() mock_publish.assert_called_once_with() mock_publish.reset_mock()