python-influxdb/python-influxdb.spec
Markéta Machová bd6b87a9d1 Accepting request 1093753 from home:favogt:branches:devel:languages:python
This fixes building with pandas >= 2, but breaks with 1.5. Is that ok?

- Add patch to fix tests with newer pandas:
  * python-influxdb-new-pandas.patch

OBS-URL: https://build.opensuse.org/request/show/1093753
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-influxdb?expand=0&rev=34
2023-06-19 11:02:38 +00:00

89 lines
3.0 KiB
RPMSpec

#
# spec file for package python-influxdb
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define skip_python2 1
%define skip_python36 1
Name: python-influxdb
Version: 5.3.1
Release: 0
Summary: InfluxDB client
License: MIT
Group: Development/Languages/Python
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
# do not require six (repo archived in favour of influxdb2, not reporting)
Patch2: python-influxdb-no-six.patch
# fix tests with newer pandas
Patch3: python-influxdb-new-pandas.patch
BuildRequires: %{python_module python-dateutil >= 2.6.0}
BuildRequires: %{python_module pytz}
BuildRequires: %{python_module requests >= 2.17.0}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-msgpack
Requires: python-python-dateutil >= 2.6.0
Requires: python-pytz
Requires: python-requests >= 2.17.0
ExcludeArch: %ix86 %arm ppc
# SECTION test requirements
BuildRequires: %{python_module msgpack}
BuildRequires: %{python_module pandas}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests-mock}
BuildRequires: influxdb
%if 0%{?suse_version} >= 1500
BuildRequires: hostname
%endif
# /SECTION
%python_subpackages
%description
InfluxDB-Python is a client for interacting with InfluxDB 1.x
%prep
%autosetup -p1 -n influxdb-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# 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
# 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}/influxdb
%{python_sitelib}/influxdb-%{version}*-info
%changelog