## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%global srcname geopandas

# There is a build dependency loop when built with tests.
# It involves libpysal, mapclassify, networkx.
# This bcond allows to bootstrap it.
%bcond bootstrap 1

Name:           python-%{srcname}
Version:        0.14.0
Release:        %autorelease
Summary:        Geographic Pandas extensions

License:        BSD-3-Clause
URL:            https://pypi.python.org/pypi/%{srcname}
Source0:        https://github.com/%{srcname}/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch

%global _description \
GeoPandas is a project to add support for geographic data to Pandas objects. \
\
The goal of GeoPandas is to make working with geospatial data in Python easier. \
It combines the capabilities of Pandas and Shapely, providing geospatial \
operations in Pandas and a high-level interface to multiple geometries to \
Shapely. GeoPandas enables you to easily do operations in Python that would \
otherwise require a spatial database such as PostGIS.

%description %{_description}


%package -n python3-%{srcname}
Summary:        %{summary}
BuildRequires:  python3-devel

%if %{without bootstrap}
BuildRequires:  python3dist(numpy) >= 1.15
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(fsspec)
BuildRequires:  python3dist(psycopg2)
BuildRequires:  python3dist(rtree) >= 0.8
BuildRequires:  python3dist(sqlalchemy)
BuildRequires:  python3dist(matplotlib) >= 3.3.4
BuildRequires:  python3dist(mapclassify)
# See:
# Depend on pandas[test] for testing
# https://github.com/geopandas/geopandas/pull/2438
BuildRequires:  python3dist(pandas[test])
%endif

%description -n python3-%{srcname} %{_description}

%prep
%autosetup -n %{srcname}-%{version} -p1

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files %{srcname}

%check
%if %{without bootstrap}
%{pytest} -ra geopandas -m 'not web'
%else
# naturalearth_creation assumes zipfile from naturalearthdata was downloaded to current directory
%pyproject_check_import -e 'geopandas.*test*' -e geopandas.datasets.naturalearth_creation
%endif

%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE.txt
%doc README.md CHANGELOG.md

%changelog
* Sat Sep 16 2023 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.14.0-1
- Update to latest version (#2239113)

* Thu Jul 20 2023 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13.2-2
- Bootstrap for Python 3.12b4

* Sun Jun 11 2023 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13.2-1
- Update to latest version (#2212271)

* Sun May 07 2023 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13.0-1
- Update to latest version (#2195910)

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sat Dec 10 2022 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.12.2-1
- Update to latest version (#2152334)

* Sun Nov 20 2022 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.12.1-1
- Update to latest version (#2137275)

* Sun Jul 31 2022 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.11.1-1
- Update to latest version (#2099491)

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jul 04 2022 Python Maint <python-maint@redhat.com> - 0.10.2-7
- Rebuilt for Python 3.11

* Tue Jun 21 2022 Python Maint <python-maint@redhat.com> - 0.10.2-6
- Bootstrap for Python 3.11

* Wed Jun 15 2022 Miro Hrončok <miro@hroncok.cz> - 0.10.2-5
- Introduce a tests bcond

* Sun May 22 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.10.2-4
- Add a BR on python3dist(pandas[test])

* Sun May 08 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.10.2-3
- Fix test failures with pandas 1.4

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sun Oct 17 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.10.2-1
- Update to latest version (#2014734)

* Sat Oct 09 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.10.1-1
- Update to latest version (#2012104)

* Sun Oct 03 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.10.0-1
- Update to latest version (#2010112)

* Sun Oct 03 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.9.0-9
- Switch to latest Python macros

* Mon Sep 13 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.9.0-4
- Backport patches for GDAL 3.3 (#1981675)

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Thu Jun 17 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.9.0-2
- Update & correct dependencies
- Backport patch to fix tests with Proj 8.0.1
- Skip tests broken on GDAL 3.3.0

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.9.0-2
- Rebuilt for Python 3.10

* Sun Feb 28 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.9.0-1
- Update to latest version (#1933514)

* Sat Feb 06 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.8.2-1
- Update to latest version (#1920235)

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jul 17 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.8.1-2
- Fix alternate architecture patch.

* Thu Jul 16 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.8.1-1
- Update to latest version

* Thu Jul 02 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.8.0-1
- Update to latest version

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.7.0-2
- Rebuilt for Python 3.9

* Tue Feb 18 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.7.0-1
- Update to latest version

* Sat Feb 08 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.6.3-1
- Update to latest version

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Sun Sep 29 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.6.0-1
- Update to latest version

* Sat Aug 24 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.6.0-0.1.rc1
- Update to latest release candidate

* Sat Aug 24 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.5.1-1
- Update to latest version

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.5.0-3
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Apr 27 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.5.0-1
- Update to latest version

* Sat Mar 09 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.4.1-1
- Update to latest version

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Sep 21 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.0-2
- Drop Python 2 subpackage

* Wed Jul 18 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.4.0-1
- Update to latest version

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Jul 11 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.0-6
- Add patch to build against Pandas 0.23.0

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.3.0-6
- Rebuilt for Python 3.7

* Wed Feb 14 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.0-5
- rebuilt

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sat Dec 09 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.0-3
- Add patch for non-x86 systems.
- Use python2-* BR.

* Fri Dec 01 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.0-2
- Add patch for non-x86 systems.

* Tue Sep 19 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.0-1
- Update to latest version.
- Use lowercase rtree dependency.
- Fix inconsistent capitalization.

* Sat Aug 12 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.2.1-3
- Simplify spec with more macros.

* Sun Jul 09 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.2.1-2
- Simplify spec a bit.
- Add patch for new Pandas compatibility.

* Sun Mar 05 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.2.1-1
- Initial package release.