From fbc03e747c125a2e706ca7c089326b667206e0cab9e1eb9ca9f099b71c83abbc Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 17 Apr 2021 08:38:18 +0000 Subject: [PATCH] Accepting request 885694 from home:bnavigator:branches:devel:languages:python - Skip python36: Extensive use of pandas in the test suite - Add influxdb-pr845-pandas-future.patch gh#influxdb/influxdb-python#845 - Skip tests failing with pandas -- #influxdb/influxdb-python#884 - Don't use extra mock OBS-URL: https://build.opensuse.org/request/show/885694 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-influxdb?expand=0&rev=27 --- influxdb-pr845-pandas-future.patch | 22 ++++++++++++++++++++++ python-influxdb.changes | 9 +++++++++ python-influxdb.spec | 28 ++++++++++++++++++---------- 3 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 influxdb-pr845-pandas-future.patch diff --git a/influxdb-pr845-pandas-future.patch b/influxdb-pr845-pandas-future.patch new file mode 100644 index 0000000..fd02837 --- /dev/null +++ b/influxdb-pr845-pandas-future.patch @@ -0,0 +1,22 @@ +From db0714de2350493a1776ca4d4d9b743695d68576 Mon Sep 17 00:00:00 2001 +From: Christopher Head +Date: Sat, 22 Aug 2020 11:15:33 -0700 +Subject: [PATCH] Fix FutureWarning from pandas + +--- + influxdb/_dataframe_client.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/influxdb/_dataframe_client.py b/influxdb/_dataframe_client.py +index e7ae9c17..1363cbf0 100644 +--- a/influxdb/_dataframe_client.py ++++ b/influxdb/_dataframe_client.py +@@ -305,7 +305,7 @@ def _convert_dataframe_to_json(dataframe, + 'time': np.int64(ts.value / precision_factor)} + for ts, tag, (_, rec) in zip( + dataframe.index, +- dataframe[tag_columns].to_dict('record'), ++ dataframe[tag_columns].to_dict('records'), + dataframe[field_columns].iterrows() + ) + ] diff --git a/python-influxdb.changes b/python-influxdb.changes index dc10179..ee4114a 100644 --- a/python-influxdb.changes +++ b/python-influxdb.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Apr 15 14:29:34 UTC 2021 - Ben Greiner + +- Skip python36: Extensive use of pandas in the test suite +- Add influxdb-pr845-pandas-future.patch + gh#influxdb/influxdb-python#845 +- Skip tests failing with pandas -- #influxdb/influxdb-python#884 +- Don't use extra mock + ------------------------------------------------------------------- Tue Feb 2 00:19:18 UTC 2021 - Dirk Müller diff --git a/python-influxdb.spec b/python-influxdb.spec index 97288ec..6f35339 100644 --- a/python-influxdb.spec +++ b/python-influxdb.spec @@ -16,8 +16,9 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%global skip_python2 1 +%{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 +%define skip_python36 1 Name: python-influxdb Version: 5.3.1 Release: 0 @@ -28,6 +29,8 @@ URL: https://github.com/influxdb/influxdb-python Source: https://files.pythonhosted.org/packages/source/i/influxdb/influxdb-%{version}.tar.gz # https://github.com/influxdata/influxdb-python/pull/835 Patch0: python-influxdb-remove-nose.patch +# PATCH-FIX-UPSTREAM influxdb-pr845-pandas-future.patch -- gh#influxdb/influxdb-python#845 +Patch1: https://github.com/influxdata/influxdb-python/pull/845.patch#/influxdb-pr845-pandas-future.patch BuildRequires: %{python_module python-dateutil >= 2.6.0} BuildRequires: %{python_module pytz} BuildRequires: %{python_module requests >= 2.17.0} @@ -42,7 +45,6 @@ Requires: python-requests >= 2.17.0 Requires: python-six >= 1.10.0 BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module mock} BuildRequires: %{python_module msgpack} BuildRequires: %{python_module pandas} BuildRequires: %{python_module pytest} @@ -55,25 +57,31 @@ BuildRequires: hostname %python_subpackages %description -InfluxDB-Python is a client for interacting with InfluxDB_. Maintained by @aviau (https://github.com/aviau). +InfluxDB-Python is a client for interacting with InfluxDB 1.x %prep -%setup -q -n influxdb-%{version} -%patch0 -p1 +%autosetup -p1 -n influxdb-%{version} +# remove extra mock +sed -e 's/^import mock/from unittest import mock/' \ + -e 's/^from mock import/from unittest.mock import/' \ + -i influxdb/tests/*.py influxdb/tests/*/*.py %build %python_build -%check -%pytest influxdb - %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%check +# https://github.com/influxdata/influxdb-python/issues/884 +donttest="test_write_points_from_dataframe_with_nan_json or test_write_points_from_dataframe_with_tags_and_nan_json" +%pytest influxdb -k "not ($donttest)" + %files %{python_files} %license LICENSE %doc README.rst -%{python_sitelib}/* +%{python_sitelib}/influxdb +%{python_sitelib}/influxdb-%{version}*-info %changelog