Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build/
mock*/
nose*/
.pybuild/
.mypy_cache/
debian/files
debian/python-influxdb.debhelper.log
debian/python-influxdb.postinst.debhelper
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ matrix:
env: TOX_ENV=flake8
- python: 3.7
env: TOX_ENV=coverage
- python: 3.7
env: TOX_ENV=mypy

install:
- pip install tox-travis
Expand Down
2 changes: 1 addition & 1 deletion influxdb/dataframe_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ def __init__(self, *a, **kw):
raise ImportError("DataFrameClient requires Pandas "
"which couldn't be imported: %s" % self.err)
else:
from ._dataframe_client import DataFrameClient
from ._dataframe_client import DataFrameClient # type: ignore
11 changes: 9 additions & 2 deletions influxdb/tests/server_tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,15 @@ class SingleTestCaseWithServerMixin(object):
# 'influxdb_template_conf' attribute must be set
# on the TestCase class or instance.

setUp = _setup_influxdb_server
tearDown = _teardown_influxdb_server
@classmethod
def setUp(cls):
"""Set up an instance of the SingleTestCaseWithServerMixin."""
_setup_influxdb_server(cls)

@classmethod
def tearDown(cls):
"""Tear down an instance of the SingleTestCaseWithServerMixin."""
_teardown_influxdb_server(cls)


class ManyTestCasesWithServerMixin(object):
Expand Down
8 changes: 8 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[mypy]
ignore_missing_imports = True
warn_unused_ignores = True
warn_unused_configs = True
warn_redundant_casts = True
warn_no_return = True
no_implicit_optional = True
strict_equality = True
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py35, py36, py37, pypy, pypy3, flake8, pep257, coverage, docs
envlist = py27, py35, py36, py37, pypy, pypy3, flake8, pep257, coverage, docs, mypy

[testenv]
passenv = INFLUXDB_PYTHON_INFLUXD_PATH
Expand Down Expand Up @@ -44,6 +44,11 @@ deps = -r{toxinidir}/requirements.txt
sphinx_rtd_theme
commands = sphinx-build -b html docs/source docs/build

[testenv:mypy]
deps = -r{toxinidir}/test-requirements.txt
mypy==0.720
commands = mypy --config-file mypy.ini -p influxdb

[flake8]
ignore = W503,W504,W605,N802,F821,E402
# W503: Line break occurred before a binary operator
Expand Down