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
This commit is contained in:
Dirk Mueller 2021-04-17 08:38:18 +00:00 committed by Git OBS Bridge
parent e5454d29ba
commit fbc03e747c
3 changed files with 49 additions and 10 deletions

View File

@ -0,0 +1,22 @@
From db0714de2350493a1776ca4d4d9b743695d68576 Mon Sep 17 00:00:00 2001
From: Christopher Head <chead@chead.ca>
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()
)
]

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Apr 15 14:29:34 UTC 2021 - Ben Greiner <code@bnavigator.de>
- 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 <dmueller@suse.com>

View File

@ -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