Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

[WIP] add py37 and recent influxdb #692

Merged
merged 8 commits into from
Mar 15, 2019
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
36 changes: 31 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ python:
- "pypy3"

env:
- INFLUXDB_VER=1.2.4
- INFLUXDB_VER=1.3.9
- INFLUXDB_VER=1.4.2
- INFLUXDB_VER=1.5.4
- INFLUXDB_VER=1.2.4 # 2017-05-08
- INFLUXDB_VER=1.3.9 # 2018-01-19
- INFLUXDB_VER=1.4.3 # 2018-01-30
- INFLUXDB_VER=1.5.4 # 2018-06-22
- INFLUXDB_VER=1.6.4 # 2018-10-24
- INFLUXDB_VER=1.7.4 # 2019-02-14

addons:
apt:
Expand All @@ -20,7 +22,31 @@ addons:

matrix:
include:
- python: 2.7
- python: 3.7
dist: xenial
sudo: true
env: INFLUXDB_VER=1.2.4
- python: 3.7
dist: xenial
sudo: true
env: INFLUXDB_VER=1.3.9
- python: 3.7
dist: xenial
sudo: true
env: INFLUXDB_VER=1.4.3
- python: 3.7
dist: xenial
sudo: true
env: INFLUXDB_VER=1.5.4
- python: 3.7
dist: xenial
sudo: true
env: INFLUXDB_VER=1.6.4
- python: 3.7
dist: xenial
sudo: true
env: INFLUXDB_VER=1.7.4
- python: 3.6
env: TOX_ENV=pep257
- python: 3.6
env: TOX_ENV=docs
Expand Down
18 changes: 14 additions & 4 deletions influxdb/tests/dataframe_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import pandas as pd
from pandas.util.testing import assert_frame_equal
from influxdb import DataFrameClient
import numpy


@skip_if_pypy
Expand Down Expand Up @@ -396,10 +397,16 @@ def test_write_points_from_dataframe_with_numeric_precision(self):
["2", 2, 2.2222222222222]],
index=[now, now + timedelta(hours=1)])

expected_default_precision = (
b'foo,hello=there 0=\"1\",1=1i,2=1.11111111111 0\n'
b'foo,hello=there 0=\"2\",1=2i,2=2.22222222222 3600000000000\n'
)
if tuple(map(int, numpy.version.version.split('.'))) <= (1, 13, 3):
expected_default_precision = (
b'foo,hello=there 0=\"1\",1=1i,2=1.11111111111 0\n'
b'foo,hello=there 0=\"2\",1=2i,2=2.22222222222 3600000000000\n'
)
else:
expected_default_precision = (
b'foo,hello=there 0=\"1\",1=1i,2=1.1111111111111 0\n'
b'foo,hello=there 0=\"2\",1=2i,2=2.2222222222222 3600000000000\n' # noqa E501 line too long
)

expected_specified_precision = (
b'foo,hello=there 0=\"1\",1=1i,2=1.1111 0\n'
Expand All @@ -419,6 +426,9 @@ def test_write_points_from_dataframe_with_numeric_precision(self):
cli = DataFrameClient(database='db')
cli.write_points(dataframe, "foo", {"hello": "there"})

print(expected_default_precision)
print(m.last_request.body)

self.assertEqual(m.last_request.body, expected_default_precision)

cli = DataFrameClient(database='db')
Expand Down
30 changes: 20 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
[tox]
envlist = py27, py35, py36, pypy, pypy3, flake8, pep257, coverage, docs
envlist = py27, py35, py36, py37, pypy, pypy3, flake8, pep257, coverage, docs

[testenv]
passenv = INFLUXDB_PYTHON_INFLUXD_PATH
setenv = INFLUXDB_PYTHON_SKIP_SERVER_TESTS=False
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
py27,py34,py35,py36: pandas==0.20.1
py27,py34,py35,py36: numpy==1.13.3
py27: pandas==0.21.1
py27: numpy==1.13.3
py35: pandas==0.22.0
py35: numpy==1.14.6
py36: pandas==0.23.4
py36: numpy==1.15.4
py37: pandas==0.24.2
py37: numpy==1.16.2
# Only install pandas with non-pypy interpreters
# Testing all combinations would be too expensive
commands = nosetests -v --with-doctest {posargs}

[testenv:flake8]
deps =
flake8
pep8-naming
commands = flake8 --ignore=W503,W504,W605,N802,F821 influxdb
commands = flake8 influxdb

[testenv:pep257]
deps = pydocstyle
Expand All @@ -26,19 +33,22 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
pandas
coverage
numpy==1.13.3
numpy
commands = nosetests -v --with-coverage --cover-html --cover-package=influxdb

[testenv:docs]
deps = -r{toxinidir}/requirements.txt
pandas==0.20.1
numpy==1.13.3
Sphinx==1.5.5
pandas==0.24.2
numpy==1.16.2
Sphinx==1.8.5
sphinx_rtd_theme
commands = sphinx-build -b html docs/source docs/build

[flake8]
ignore = N802,F821,E402
# E402: module level import not at top of file
ignore = W503,W504,W605,N802,F821,E402
# W503: Line break occurred before a binary operator
# W504: Line break occurred after a binary operator
# W605: invalid escape sequence
# N802: nosetests's setUp function
# F821: False positive in intluxdb/dataframe_client.py
# E402: module level import not at top of file