## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## 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

# Sphinx-generated HTML documentation is not suitable for packaging; see
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
#
# We can generate PDF documentation as a substitute.
# EPEL10 does not (yet) have pandoc.
%bcond doc_pdf %{undefined el10}

Name:           python-OWSLib
Version:        0.32.0
Release:        %autorelease
Summary:        OGC Web Service utility library

License:        BSD-3-Clause
URL:            https://geopython.github.io/OWSLib
# A filtered source archive, obtained by (see Source1):
#
#   ./get_source %%{version}
#
# is required because tests/resources/ contains XML data files that appear to
# have been pulled from various GIS databases, and the license terms for these
# files are unclear.
#
# The unfiltered base source URL would be:
#
# https://github.com/geopython/OWSLib/archive/%%{version}/OWSLib-%%{version}.tar.gz
#
# We *could* use the PyPI sdist, which does not contain tests/resources/, but
# it also does not contain any tests at all. We can still run some tests
# without the XML files, and we would like to do so.
Source0:        OWSLib-%{version}-filtered.tar.zst
Source1:        get_source

BuildArch:      noarch

BuildRequires:  python3-devel

%if %{with doc_pdf}
BuildRequires:  make
BuildRequires:  python3-sphinx-latex
BuildRequires:  latexmk
BuildRequires:  pandoc
%endif

%global common_description %{expand:
OWSLib is a Python package for client programming with Open Geospatial
Consortium (OGC) web service (hence OWS) interface standards, and their related
content models.

Full documentation is available at http://geopython.github.io/OWSLib

OWSLib provides a common API for accessing service metadata and wrappers for
numerous OGC Web Service interfaces.}

%description %{common_description}


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

%py_provides python3-owslib

%description -n python3-OWSLib %{common_description}


%package doc
Summary:        Documentation and examples for OWSLib

%description doc
%{summary}.


%prep
%autosetup -n OWSLib-%{version}

# Don’t analyze/report test coverage
sed -r -i 's/[-]-cov[^[:blank:]]*[[:blank:]][^[[:blank:]]+//g' tox.ini
# Don’t generate linting/coverage dependencies.
#
# We don’t have python3dist(pandoc) packaged, and besides, we don’t actually
# need python3dist(pandoc)—only the pandoc command-line tool, which we have
# manually BR’d.
#
# Don’t generate twine dependency, which is just for the upstream maintainer
# uploading to PyPI.
sed -r -e '/^(flake8|pytest-cov|twine|coverage|coveralls)\b/d' \
    requirements-dev.txt | tee requirements-dev-filtered.txt

# We don’t need shebangs in the examples. The pattern of selecting files
# before modifying them with sed keeps us from unnecessarily discarding the
# original mtimes on unmodified files.
find 'examples' -type f -name '*.py' \
    -exec gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' |
  xargs -r sed -r -i '1{/^#!/d}'
# Some of them, but not all of them, were executable.
chmod -v a-x examples/*.py

# Because at least one notebook requires Internet access, we must continue past
# notebook errors when building documentation.
echo 'nbsphinx_allow_errors = True' >> docs/source/conf.py


%generate_buildrequires
%{pyproject_buildrequires \
    %{?with_doc_pdf:docs/requirements.txt} \
    requirements-dev-filtered.txt}


%build
%pyproject_wheel

%if %{with doc_pdf}
PYTHONPATH="${PWD}" %make_build -C docs latex \
    SPHINXOPTS='-j%{?_smp_build_ncpus}'
%make_build -C docs/build/latex LATEXMKOPTS='-quiet'
%endif


%install
%pyproject_install
%pyproject_save_files -l owslib


%check
# Otherwise, pytest finds the package twice in the Python path and complains.
rm -rf owslib

# This requires network access (during test collection!)
ignore="${ignore-} --ignore=tests/test_ogcapi_connectedsystems_osh.py"

# These require test data files from tests/resources/, which we have removed:
ignore="${ignore-} --ignore-glob=tests/doctests/*.txt"
k="${k-}${k+ and }not test_gm03"
ignore="${ignore-} --ignore=tests/test_iso_parsing.py"
ignore="${ignore-} --ignore=tests/test_ows_interfaces.py"
ignore="${ignore-} --ignore=tests/test_owscontext_atomxml.py"
k="${k-}${k+ and }not test_decode_single_json"
k="${k-}${k+ and }not test_load_parse"
k="${k-}${k+ and }not test_decode_full_json"
k="${k-}${k+ and }not test_load_bulk"
ignore="${ignore-} --ignore=tests/test_remote_metadata.py"
k="${k-}${k+ and }not TestOffline"
ignore="${ignore-} --ignore=tests/test_wfs_generic.py"
ignore="${ignore-} --ignore=tests/test_wms_datageo_130.py"
ignore="${ignore-} --ignore=tests/test_wms_jpl_capabilities.py"
k="${k-}${k+ and }not test_wps_getOperationByName"
k="${k-}${k+ and }not test_wps_checkStatus"
k="${k-}${k+ and }not test_wps_process_representation"
k="${k-}${k+ and }not test_wps_process_properties"
k="${k-}${k+ and }not test_wps_literal_data_input_parsing_references"
k="${k-}${k+ and }not test_wps_response_with_lineage"
ignore="${ignore-} --ignore=tests/test_wps_describeprocess_bbox.py"
ignore="${ignore-} --ignore=tests/test_wps_describeprocess_ceda.py"
ignore="${ignore-} --ignore=tests/test_wps_describeprocess_emu_all.py"
ignore="${ignore-} --ignore=tests/test_wps_describeprocess_usgs.py"
ignore="${ignore-} --ignore=tests/test_wps_execute.py"
ignore="${ignore-} --ignore=tests/test_wps_execute_invalid_request.py"
ignore="${ignore-} --ignore=tests/test_wps_getcapabilities_52n.py"
ignore="${ignore-} --ignore=tests/test_wps_getcapabilities_ceda.py"
ignore="${ignore-} --ignore=tests/test_wps_getcapabilities_usgs.py"
ignore="${ignore-} --ignore-glob=tests/test_wps_request*.py"
ignore="${ignore-} --ignore-glob=tests/test_wps_response*.py"
k="${k-}${k+ and }not test_metadata"
k="${k-}${k+ and }not test_responsibility"
k="${k-}${k+ and }not test_distributor"
k="${k-}${k+ and }not test_online_distribution"
k="${k-}${k+ and }not test_identification"
k="${k-}${k+ and }not test_identification_contact"
k="${k-}${k+ and }not test_identification_date"
k="${k-}${k+ and }not test_identification_extent"
k="${k-}${k+ and }not test_identification_keywords"
k="${k-}${k+ and }not test_get_all_contacts"
k="${k-}${k+ and }not test_aus"
k="${k-}${k+ and }not test_service"
k="${k-}${k+ and }not test_md_featurecataloguedesc"
k="${k-}${k+ and }not test_md_imagedescription"
k="${k-}${k+ and }not test_dq_dataquality"
k="${k-}${k+ and }not test_md_reference_system"
k="${k-}${k+ and }not test_service2"
k="${k-}${k+ and }not test_md_distribution"

%pytest -m 'not online' -k "${k-}" ${ignore-} -v -rs


%files -n python3-OWSLib -f %{pyproject_files}


%files doc
%license LICENSE
%doc AUTHORS.rst
%doc README.md
%doc examples/
%if %{with doc_pdf}
%doc docs/build/latex/OWSLib.pdf
%endif


%changelog
## START: Generated by rpmautospec
* Wed Nov 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.32.0-1
- Update to 0.32.0 (close RHBZ#2321522)

* Wed Nov 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.31.0-1
- Update to 0.31.0

* Wed Nov 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.30.0-5
- Omit test data files with unclear license status

* Thu Oct 31 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.30.0-4
- Add a conditional to build in EPEL10 (without PDF docs for now)

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sun Jun 09 2024 Python Maint <python-maint@redhat.com> - 0.30.0-2
- Rebuilt for Python 3.13

* Wed Mar 20 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.30.0-1
- Update to 0.30.0 (close RHBZ#2268924)

* Wed Mar 20 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.29.3-6
- Update Summary from upstream

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Dec 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.29.3-2
- Assert that %%pyproject_files contains a license file

* Tue Nov 07 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.29.3-1
- Update to 0.29.3 (close RHBZ#2248215)

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon Jul 03 2023 Python Maint <python-maint@redhat.com> - 0.29.2-5
- Rebuilt for Python 3.12

* Tue Jun 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.29.2-4
- Use new (rpm 4.17.1+) bcond style

* Sun May 21 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.29.2-1
- Update to 0.29.2 (close RHBZ#2208756)

* Thu Apr 13 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.29.1-1
- Update to 0.29.1 (close RHBZ#2186365)

* Sun Apr 09 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.29.0-1
- Update to 0.29.0 (close RHBZ#2185445)

* Sat Mar 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.28.1-3
- Don’t assume %%_smp_mflags is -j%%_smp_build_ncpus

* Wed Mar 08 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.28.1-2
- Move some text doc files to the -doc subpackage

* Fri Feb 24 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.28.1-1
- Update to 0.28.1 (close RHBZ#2173195)

* Mon Feb 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.28.0-1
- Update to 0.28.0 (close RHBZ#2171409)

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

* Wed Nov 30 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.27.2-3
- Drop default argument -r for pyproject_buildrequires

* Wed Nov 16 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.27.2-2
- Drop some doc BR’s when PDF docs are disabled

* Sun Aug 28 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.27.2-1
- Update to 0.27.2 (close RHBZ#2122000)

* Sun Aug 28 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-6
- Update License to SPDX

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

* Mon Jul 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-4
- Fix a typo in a spec file comment

* Thu Jul 07 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-3
- Fix extra newline in description

* Tue Jun 21 2022 Python Maint <python-maint@redhat.com> - 0.26.0-2
- Rebuilt for Python 3.11

* Fri Jun 10 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-1
- Update to 0.26.0 (close RHBZ#2095806)

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

* Thu Dec 23 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.25.0-3
- Add Provides for python3-owslib

* Thu Dec 23 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.25.0-2
- Don’t generate BuildRequires on twine

* Wed Dec 22 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.25.0-1
- Update to 0.25.0 (close RHBZ#1918539)

* Tue Dec 21 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 0.21.0-6
- Modernize packaging; run tests; add -doc subpackage

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

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

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

* Wed Dec 09 2020 Volker Fröhlich <volker27@gmx.at> - 0.21.0-1
- New upstream release

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jun 05 2020 Volker Fröhlich <volker27@gmx.at> - 0.20.0-1
- New upstream release

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

* Sun Feb 02 2020 Volker Fröhlich <volker27@gmx.at> - 0.19.1-1
- New upstream release

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

* Sun Jan 19 2020 Volker Fröhlich <volker27@gmx.at> - 0.19.0-1
- New upstream release

* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.18.0-4
- Rebuilt for Python 3.8.0rc1 (#1748018)

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

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

* Wed Jun 26 2019 Volker Fröhlich <volker27@gmx.at> - 0.18.0-1
- New upstream release

* Mon Feb 11 2019 Miro Hrončok <mhroncok@redhat.com> - 0.17.0-3
- Subpackage python2-owslib has been removed
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

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

* Wed Sep 19 2018 Volker Fröhlich <volker27@gmx.at> - 0.17.0-1
- New upstream release
- Update names of documentation files

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

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

* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.16.0-3
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

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

* Fri Dec 22 2017 Volker Fröhlich <volker27@gmx.at> - 0.16.0-1
- New upstream release

* Thu Sep 14 2017 Volker Fröhlich <volker27@gmx.at> - 0.15.0-1
- New upstream release

* Tue Aug 29 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.14.0-5
- Add Provides for the old name

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.14.0-4
- Python 2 binary package renamed to python2-owslib
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Jan 12 2017 Volker Fröhlich <volker27@gmx.at> - 0.14.0-1
- New upstream release

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.13.0-2
- Rebuild for Python 3.6

* Sun Sep 25 2016 Volker Fröhlich <volker27@gmx.at> - 0.13.0-1
- New upstream release

* Tue Sep 13 2016 Volker Fröhlich <volker27@gmx.at> - 0.12.0-1
- New upstream release
- Update URL and Source

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.2-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon May 16 2016 Volker Fröhlich <volker27@gmx.at> - 0.11.2-1
- New upstream release

* Sat May 14 2016 Volker Fröhlich <volker27@gmx.at> - 0.11.1-1
- New upstream release

* Fri Apr  1 2016 Volker Fröhlich <volker27@gmx.at> - 0.11.0-1
- New upstream release

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Nov 23 2015 Volker Fröhlich <volker27@gmx.at> - 0.10.3-1
- New upstream release

* Sun Nov 22 2015 Volker Fröhlich <volker27@gmx.at> - 0.10.1-1
- New upstream release

* Thu Nov 12 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Wed Nov 11 2015 Volker Fröhlich <volker27@gmx.at> - 0.10.0-1
- New upstream release

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Fri Sep 25 2015 Volker Fröhlich <volker27@gmx.at> - 0.9.2-1
- New upstream release

* Sun Sep  6 2015 Volker Fröhlich <volker27@gmx.at> - 0.9.1-2
- Add pyproj dependency

* Sun Sep  6 2015 Volker Fröhlich <volker27@gmx.at> - 0.9.1-1
- New upstream release

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 13 2015 Volker Fröhlich <volker27@gmx.at> - 0.9.0-1
- New upstream release
- Add Python 3 sub-package

* Sat Feb 14 2015 Volker Fröhlich <volker27@gmx.at> - 0.8.13-1
- New upstream release

* Tue Dec 23 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.12-1
- New upstream release

* Wed Dec 17 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.11-1
- New upstream release

* Mon Oct 13 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.10-1
- New upstream release

* Wed Sep 24 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.9-1
- New upstream release

* Mon Jul  7 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.8-1
- New upstream release

* Wed Jul  2 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.7-3
- Changed package summary

* Tue Jul  1 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.7-2
- Correct BR python-setuptools-devel to python-setuptools

* Mon Jun 30 2014 Volker Fröhlich <volker27@gmx.at> - 0.8.7-1
- Initial package for Fedora

## END: Generated by rpmautospec