python-OWSLib/python-OWSLib.spec
2023-03-08 08:38:15 -05:00

197 lines
6.3 KiB
RPMSpec

# Works with either ElementTree or python-lxml
Name: python-OWSLib
Version: 0.9.0
Release: 2%{?dist}
Summary: Client library for OGC web services
License: BSD-3-Clause
URL: http://geopython.github.io/OWSLib
%global forgeurl https://github.com/geopython/OWSLib
Source0: %{forgeurl}/archive/%{version}/OWSLib-%{version}.tar.gz
BuildArch: noarch
%global common_description %{expand:
Package for client programming with Open Geospatial Consortium (OGC) web
service (hence OWS) interface standards, and their related content models.}
%description %{common_description}
%package -n python2-OWSLib
Summary: %{summary}
%{?python_provide:%python_provide python2-OWSLib}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pytest
BuildRequires: python2-dateutil
BuildRequires: python2-requests
BuildRequires: python2-pytz
Requires: python2-dateutil
Requires: python2-requests
Requires: python2-pytz
%description -n python2-OWSLib %{common_description}
%package -n python%{python3_pkgversion}-OWSLib
Summary: %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-OWSLib}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-dateutil
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-pytz
Requires: python%{python3_pkgversion}-dateutil
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-pytz
%description -n python%{python3_pkgversion}-OWSLib %{common_description}
%prep
%autosetup -n OWSLib-%{version}
rm -rf OWSLib.egg-info
# Remove shebangs from non-script sources. The find-then-modify pattern
# preserves mtimes on sources that did not need to be modified.
find 'owslib' -type f -name '*.py' \
-exec gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' |
xargs -r sed -r -i '1{/^#!/d}'
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -r -i 's/--cov[^[:blank:]=]*([=[:blank:]][^-][^[:blank:]]+)?//g' tox.ini
%build
%py2_build
%py3_build
%install
%py2_install
%py3_install
%check
# Otherwise, pytest finds the package twice in the Python path and complains.
rm -rf owslib
# In recent versions, there is a convenient “online” mark for deselecting tests
# that require Internet access, but we still have to manually deselect doctests
# that try to make network requests.
k="${k-}${k+ and }not (wms_geoserver_mass_gis and txt)"
k="${k-}${k+ and }not (wfs_MapServerWFSFeature and txt)"
k="${k-}${k+ and }not (wfs_MapServerWFSCapabilities and txt)"
k="${k-}${k+ and }not (wfs2_storedqueries and txt)"
k="${k-}${k+ and }not (wfs1_generic and txt)"
k="${k-}${k+ and }not (wcs_thredds and txt)"
k="${k-}${k+ and }not (test_wmts_example_informatievlaanderen and txt)"
# These require network access, and would be covered by the “online” mark:
k="${k-}${k+ and }not (WebMapService and getmap)"
k="${k-}${k+ and }not (WebMapTileService and buildTileRequest)"
k="${k-}${k+ and }not (WebMapTileService and gettile)"
k="${k-}${k+ and }not (csw_gdp and txt)"
k="${k-}${k+ and }not (csw_geoserver and txt)"
k="${k-}${k+ and }not (csw_ngdc and txt)"
k="${k-}${k+ and }not (csw_nlr and txt)"
k="${k-}${k+ and }not (csw_pycsw and txt)"
k="${k-}${k+ and }not (csw_pycsw_skip_caps and txt)"
k="${k-}${k+ and }not (csw_skgeodsy and txt)"
k="${k-}${k+ and }not (csw_uuid_constrain and txt)"
k="${k-}${k+ and }not (ows_interfaces and txt)"
k="${k-}${k+ and }not (sos_10_ndbc_getobservation and txt)"
k="${k-}${k+ and }not (tms and txt)"
k="${k-}${k+ and }not (wcs_idee and txt)"
k="${k-}${k+ and }not (wfs_USDASSURGO and txt)"
k="${k-}${k+ and }not (wms_JPLCapabilities and txt)"
k="${k-}${k+ and }not (wmts and txt)"
k="${k-}${k+ and }not (wps_execute and txt)"
k="${k-}${k+ and }not (wps_execute_invalid_request and txt)"
# Unknown problem—check if it is fixed in a later version:
k="${k-}${k+ and } not (TestOffline and test_wfs_110_remotemd_parse_all)"
k="${k-}${k+ and } not (TestOffline and test_wfs_110_remotemd_parse_single)"
k="${k-}${k+ and } not (TestOffline and test_wfs_200_remotemd_parse_single)"
k="${k-}${k+ and } not (TestOffline and test_wms_130_remotemd_parse_all)"
k="${k-}${k+ and } not (TestOffline and test_wms_130_remotemd_parse_single)"
PYTHONPATH='%{buildroot}%{python2_sitelib}' PYTHONDONTWRITEBYTECODE=1 \
%{python2} -m pytest -m 'not online' -k "${k-}"
PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \
%{python3} -m pytest -m 'not online' -k "${k-}"
%files -n python2-OWSLib
%license LICENSE.txt
%doc CHANGES.txt
%doc CREDITS.txt
%doc FAQ.txt
%doc HISTORY.txt
%doc README.txt
%{python2_sitelib}/owslib/
%{python2_sitelib}/OWSLib-%{version}-py%{python2_version}.egg-info
%files -n python%{python3_pkgversion}-OWSLib
%license LICENSE.txt
%doc CHANGES.txt
%doc CREDITS.txt
%doc FAQ.txt
%doc HISTORY.txt
%doc README.txt
%{python3_sitelib}/owslib/
%{python3_sitelib}/OWSLib-%{version}-py%{python3_version}.egg-info
%changelog
* Wed Mar 08 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.9.0-2
- Generally “modernize” packaging (by EPEL7 standards)
- Update License to SPDX
- Build the Python 3 sub-package on EPEL7
- Switch to the GitHub source archive and run the offline tests
- Install more text documentation files
* 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