Blob Blame History Raw
%bcond_without tests
%bcond_with docs

%global pypi_name earthpy

%global _description %{expand:
EarthPy makes it easier to plot and manipulate spatial data in Python.}

Name:           python-%{pypi_name}
Version:        0.9.2
Release:        4%{?dist}
Summary:        A package built to support working with spatial data

License:        BSD
Source0:        %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz

BuildArch:      noarch

%description %_description

%package -n python3-%{pypi_name}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

#For tests
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-cov

#For documentation
BuildRequires:  python3dist(sphinx)
BuildRequires:  python3dist(sphinx-rtd-theme)
BuildRequires:  python3dist(sphinx-gallery)

#Main dependencies
BuildRequires:  python3dist(geopandas)
BuildRequires:  python3dist(matplotlib)
BuildRequires:  python3dist(numpy)
BuildRequires:  python3dist(rasterio)
BuildRequires:  python3dist(scikit-image)
BuildRequires:  python3dist(requests)

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

%if %{with docs}
%package doc
Summary:        %{summary}

%description doc
Documentation for %{name}.

%autosetup -n %{pypi_name}-%{version}
rm -rf %{pypi_name}.egg-info


#Some documents are downloaded from the internet during the build.
%if %{with docs}
# Generate html docs
PYTHONPATH=${PWD} sphinx-build-3 docs/ html
# Remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}


%if %{with tests}
# Disable network tests
%pytest -k 'not test_io'

%files -n python3-%{pypi_name}
%license LICENSE
%doc examples/ CHANGELOG.rst

%if %{with docs}
%files -n python-%{pypi_name}-doc
%license LICENSE
%doc html/

* Tue Jul 27 2021 Fedora Release Engineering <> - 0.9.2-4
- Second attempt - Rebuilt for

* Fri Jun 04 2021 Python Maint <> - 0.9.2-3
- Rebuilt for Python 3.10

* Fri May 21 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.9.2-2
- Install additional docs

* Sat May 15 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.9.2-1
- Initial package