Skip to content

Commit bf95e0f

Browse files
clslgrncaviau
authored andcommitted
[WIP] add py37 and recent influxdb (influxdata#692)
* add py37 and recent influxdb * remove useless py34 dep * use py36 for pydocstyle (py27 soon deprecated) * ugly fix to numpy inconsistencies * py37 is not in ubuntu 14.04 * move import numpy and add noqa * get 3.7 into travis matrix * get 3.7 into travis matrix
1 parent 5eda204 commit bf95e0f

File tree

3 files changed

+65
-19
lines changed

3 files changed

+65
-19
lines changed

.travis.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ python:
88
- "pypy3"
99

1010
env:
11-
- INFLUXDB_VER=1.2.4
12-
- INFLUXDB_VER=1.3.9
13-
- INFLUXDB_VER=1.4.2
14-
- INFLUXDB_VER=1.5.4
11+
- INFLUXDB_VER=1.2.4 # 2017-05-08
12+
- INFLUXDB_VER=1.3.9 # 2018-01-19
13+
- INFLUXDB_VER=1.4.3 # 2018-01-30
14+
- INFLUXDB_VER=1.5.4 # 2018-06-22
15+
- INFLUXDB_VER=1.6.4 # 2018-10-24
16+
- INFLUXDB_VER=1.7.4 # 2019-02-14
1517

1618
addons:
1719
apt:
@@ -20,7 +22,31 @@ addons:
2022

2123
matrix:
2224
include:
23-
- python: 2.7
25+
- python: 3.7
26+
dist: xenial
27+
sudo: true
28+
env: INFLUXDB_VER=1.2.4
29+
- python: 3.7
30+
dist: xenial
31+
sudo: true
32+
env: INFLUXDB_VER=1.3.9
33+
- python: 3.7
34+
dist: xenial
35+
sudo: true
36+
env: INFLUXDB_VER=1.4.3
37+
- python: 3.7
38+
dist: xenial
39+
sudo: true
40+
env: INFLUXDB_VER=1.5.4
41+
- python: 3.7
42+
dist: xenial
43+
sudo: true
44+
env: INFLUXDB_VER=1.6.4
45+
- python: 3.7
46+
dist: xenial
47+
sudo: true
48+
env: INFLUXDB_VER=1.7.4
49+
- python: 3.6
2450
env: TOX_ENV=pep257
2551
- python: 3.6
2652
env: TOX_ENV=docs

influxdb/tests/dataframe_client_test.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import pandas as pd
2323
from pandas.util.testing import assert_frame_equal
2424
from influxdb import DataFrameClient
25+
import numpy
2526

2627

2728
@skip_if_pypy
@@ -396,10 +397,16 @@ def test_write_points_from_dataframe_with_numeric_precision(self):
396397
["2", 2, 2.2222222222222]],
397398
index=[now, now + timedelta(hours=1)])
398399

399-
expected_default_precision = (
400-
b'foo,hello=there 0=\"1\",1=1i,2=1.11111111111 0\n'
401-
b'foo,hello=there 0=\"2\",1=2i,2=2.22222222222 3600000000000\n'
402-
)
400+
if tuple(map(int, numpy.version.version.split('.'))) <= (1, 13, 3):
401+
expected_default_precision = (
402+
b'foo,hello=there 0=\"1\",1=1i,2=1.11111111111 0\n'
403+
b'foo,hello=there 0=\"2\",1=2i,2=2.22222222222 3600000000000\n'
404+
)
405+
else:
406+
expected_default_precision = (
407+
b'foo,hello=there 0=\"1\",1=1i,2=1.1111111111111 0\n'
408+
b'foo,hello=there 0=\"2\",1=2i,2=2.2222222222222 3600000000000\n' # noqa E501 line too long
409+
)
403410

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

429+
print(expected_default_precision)
430+
print(m.last_request.body)
431+
422432
self.assertEqual(m.last_request.body, expected_default_precision)
423433

424434
cli = DataFrameClient(database='db')

tox.ini

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
[tox]
2-
envlist = py27, py35, py36, pypy, pypy3, flake8, pep257, coverage, docs
2+
envlist = py27, py35, py36, py37, pypy, pypy3, flake8, pep257, coverage, docs
33

44
[testenv]
55
passenv = INFLUXDB_PYTHON_INFLUXD_PATH
66
setenv = INFLUXDB_PYTHON_SKIP_SERVER_TESTS=False
77
deps = -r{toxinidir}/requirements.txt
88
-r{toxinidir}/test-requirements.txt
9-
py27,py34,py35,py36: pandas==0.20.1
10-
py27,py34,py35,py36: numpy==1.13.3
9+
py27: pandas==0.21.1
10+
py27: numpy==1.13.3
11+
py35: pandas==0.22.0
12+
py35: numpy==1.14.6
13+
py36: pandas==0.23.4
14+
py36: numpy==1.15.4
15+
py37: pandas==0.24.2
16+
py37: numpy==1.16.2
1117
# Only install pandas with non-pypy interpreters
18+
# Testing all combinations would be too expensive
1219
commands = nosetests -v --with-doctest {posargs}
1320

1421
[testenv:flake8]
1522
deps =
1623
flake8
1724
pep8-naming
18-
commands = flake8 --ignore=W503,W504,W605,N802,F821 influxdb
25+
commands = flake8 influxdb
1926

2027
[testenv:pep257]
2128
deps = pydocstyle
@@ -26,19 +33,22 @@ deps = -r{toxinidir}/requirements.txt
2633
-r{toxinidir}/test-requirements.txt
2734
pandas
2835
coverage
29-
numpy==1.13.3
36+
numpy
3037
commands = nosetests -v --with-coverage --cover-html --cover-package=influxdb
3138

3239
[testenv:docs]
3340
deps = -r{toxinidir}/requirements.txt
34-
pandas==0.20.1
35-
numpy==1.13.3
36-
Sphinx==1.5.5
41+
pandas==0.24.2
42+
numpy==1.16.2
43+
Sphinx==1.8.5
3744
sphinx_rtd_theme
3845
commands = sphinx-build -b html docs/source docs/build
3946

4047
[flake8]
41-
ignore = N802,F821,E402
42-
# E402: module level import not at top of file
48+
ignore = W503,W504,W605,N802,F821,E402
49+
# W503: Line break occurred before a binary operator
50+
# W504: Line break occurred after a binary operator
51+
# W605: invalid escape sequence
4352
# N802: nosetests's setUp function
4453
# F821: False positive in intluxdb/dataframe_client.py
54+
# E402: module level import not at top of file

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy