From 384c14733c54659838ff5cb7e78f9aef69a6f603 Mon Sep 17 00:00:00 2001 From: Dave Johansen Date: Sun, 14 Jun 2015 17:56:11 -0700 Subject: [PATCH 01/12] Turn off Python 3 support in EPEL --- python-OWSLib.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 023bd7e..3bcac9e 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -1,6 +1,6 @@ # Works with either ElementTree or python-lxml %global modname OWSLib -%global with_python3 1 +%global with_python3 0%{?fedora} Name: python-%{modname} Version: 0.9.0 From 36ed902e1eda8ba0cbe89ebe7973563f6e942fbb Mon Sep 17 00:00:00 2001 From: Dave Johansen Date: Sun, 20 Sep 2015 09:37:10 -0700 Subject: [PATCH 02/12] Reverting back to 0.9.0 since 0.9.1 adds a dependency on pyproj (which isn't available and would be non-trivial to add) --- .gitignore | 1 - python-OWSLib.spec | 8 +------- sources | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1b36647..c3a838b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ /OWSLib-0.8.12.tar.gz /OWSLib-0.8.13.tar.gz /OWSLib-0.9.0.tar.gz -/OWSLib-0.9.1.tar.gz diff --git a/python-OWSLib.spec b/python-OWSLib.spec index e7c2cf2..3bcac9e 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -3,7 +3,7 @@ %global with_python3 0%{?fedora} Name: python-%{modname} -Version: 0.9.1 +Version: 0.9.0 Release: 1%{?dist} Summary: Client library for OGC web services License: BSD @@ -93,12 +93,6 @@ popd %endif # if with_python3 %changelog -* Sun Sep 6 2015 Volker Fröhlich - 0.9.1-1 -- New upstream release - -* Thu Jun 18 2015 Fedora Release Engineering - 0.9.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - * Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 - New upstream release - Add Python 3 sub-package diff --git a/sources b/sources index bb523ea..babaa82 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9ca33a5815d07ae8c97dfa3747118d2c OWSLib-0.9.1.tar.gz +e511e8bdddce0e59abefc892f090e033 OWSLib-0.9.0.tar.gz From 962fd669cf1e1a5eeae12fd22483fd15feebb170 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 07:29:46 -0500 Subject: [PATCH 03/12] =?UTF-8?q?Generally=20=E2=80=9Cmodernize=E2=80=9D?= =?UTF-8?q?=20packaging=20(by=20EPEL7=20standards)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-OWSLib.spec | 136 ++++++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 62 deletions(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 3bcac9e..9f53b68 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -1,98 +1,110 @@ # Works with either ElementTree or python-lxml -%global modname OWSLib %global with_python3 0%{?fedora} -Name: python-%{modname} +Name: python-OWSLib Version: 0.9.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Client library for OGC web services + License: BSD URL: http://geopython.github.io/OWSLib -Source0: http://pypi.python.org/packages/source/O/%{modname}/%{modname}-%{version}.tar.gz +Source0: %{pypi_source OWSLib} 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: python-setuptools -Requires: python-dateutil -Requires: python-requests -Requires: pytz +BuildRequires: python2-setuptools + +BuildRequires: python2-dateutil +BuildRequires: python2-requests +BuildRequires: python2-pytz + +Requires: python2-dateutil +Requires: python2-requests +Requires: python2-pytz + +%description -n python2-OWSLib %{common_description} + %if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools +%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}-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} %endif # if with_python3 -%description -Package for client programming with Open Geospatial Consortium (OGC) web -service (hence OWS) interface standards, and their related content models. - -%if 0%{?with_python3} -%package -n python3-OWSLib -Summary: Client library for OGC web services - -Requires: python3-dateutil -Requires: python3-requests -Requires: python3-pytz - -%description -n python3-OWSLib -Package for client programming with Open Geospatial Consortium (OGC) web -service (hence OWS) interface standards, and their related content models. -%endif # if with_python3 %prep -%setup -qc -n %{modname}-%{version} -rm -rf %{modname}-%{version}/%{modname}.egg-info -mv %{modname}-%{version} python2 +%autosetup -n OWSLib-%{version} +rm -rf OWSLib.egg-info -%if 0%{?with_python3} -cp -a python2 python3 -find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif # with_python3 - -find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' - -pushd python2 -cp -pr LICENSE.txt README.txt CHANGES.txt CREDITS.txt ../ -popd +# 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}' %build -pushd python2 -%{__python2} setup.py build -popd - +%py2_build %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py build -popd -%endif # if with_python3 +%py3_build +%endif %install -pushd python2 -%{__python2} setup.py install --skip-build --root %{buildroot} -popd - +%py2_install %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py install --skip-build --root %{buildroot} -popd +%py3_install %endif # if with_python3 -%files -%doc LICENSE.txt README.txt CHANGES.txt CREDITS.txt -%{python_sitelib}/owslib -%{python_sitelib}/%{modname}-%{version}-py*.egg-info +%files -n python2-OWSLib +%license LICENSE.txt +%doc README.txt CHANGES.txt CREDITS.txt + +%{python2_sitelib}/owslib/ +%{python2_sitelib}/OWSLib-%{version}-py%{python2_version}.egg-info + %if 0%{?with_python3} -%files -n python3-OWSLib -%doc LICENSE.txt README.txt CHANGES.txt CREDITS.txt -%{python3_sitelib}/owslib -%{python3_sitelib}/%{modname}-%{version}-py*.egg-info +%files -n python%{python3_pkgversion}-OWSLib +%license LICENSE.txt +%doc README.txt CHANGES.txt CREDITS.txt + +%{python3_sitelib}/owslib/ +%{python3_sitelib}/OWSLib-%{version}-py%{python3_version}.egg-info %endif # if with_python3 + %changelog +* Wed Mar 08 2023 Benjamin A. Beasley - 0.9.0-2 +- Generally “modernize” packaging (by EPEL7 standards) + * Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 - New upstream release - Add Python 3 sub-package From 417d4722f6ee8f7c92fc033cd16be06282b4f95e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 07:47:39 -0500 Subject: [PATCH 04/12] Update License to SPDX --- python-OWSLib.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 9f53b68..905ba36 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -6,7 +6,7 @@ Version: 0.9.0 Release: 2%{?dist} Summary: Client library for OGC web services -License: BSD +License: BSD-3-Clause URL: http://geopython.github.io/OWSLib Source0: %{pypi_source OWSLib} BuildArch: noarch @@ -104,6 +104,7 @@ find 'owslib' -type f -name '*.py' \ %changelog * Wed Mar 08 2023 Benjamin A. Beasley - 0.9.0-2 - Generally “modernize” packaging (by EPEL7 standards) +- Update License to SPDX * Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 - New upstream release From bcf8c16765d0101454485bb6438041d67453bb28 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 07:54:43 -0500 Subject: [PATCH 05/12] Build the Python 3 sub-package on EPEL7 --- python-OWSLib.spec | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 905ba36..ab0437e 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -1,5 +1,4 @@ # Works with either ElementTree or python-lxml -%global with_python3 0%{?fedora} Name: python-OWSLib Version: 0.9.0 @@ -37,7 +36,6 @@ Requires: python2-pytz %description -n python2-OWSLib %{common_description} -%if 0%{?with_python3} %package -n python%{python3_pkgversion}-OWSLib Summary: %{summary} @@ -55,7 +53,6 @@ Requires: python%{python3_pkgversion}-requests Requires: python%{python3_pkgversion}-pytz %description -n python%{python3_pkgversion}-OWSLib %{common_description} -%endif # if with_python3 %prep @@ -71,16 +68,12 @@ find 'owslib' -type f -name '*.py' \ %build %py2_build -%if 0%{?with_python3} %py3_build -%endif %install %py2_install -%if 0%{?with_python3} %py3_install -%endif # if with_python3 %files -n python2-OWSLib @@ -91,20 +84,19 @@ find 'owslib' -type f -name '*.py' \ %{python2_sitelib}/OWSLib-%{version}-py%{python2_version}.egg-info -%if 0%{?with_python3} %files -n python%{python3_pkgversion}-OWSLib %license LICENSE.txt %doc README.txt CHANGES.txt CREDITS.txt %{python3_sitelib}/owslib/ %{python3_sitelib}/OWSLib-%{version}-py%{python3_version}.egg-info -%endif # if with_python3 %changelog * Wed Mar 08 2023 Benjamin A. Beasley - 0.9.0-2 - Generally “modernize” packaging (by EPEL7 standards) - Update License to SPDX +- Build the Python 3 sub-package on EPEL7 * Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 - New upstream release From 5d046039a15e1cffb8de0762cdfcec148d58f55f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 08:36:55 -0500 Subject: [PATCH 06/12] Switch to the GitHub source archive and run the offline tests --- python-OWSLib.spec | 60 +++++++++++++++++++++++++++++++++++++++++++++- sources | 2 +- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index ab0437e..29ffea4 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -7,7 +7,9 @@ Summary: Client library for OGC web services License: BSD-3-Clause URL: http://geopython.github.io/OWSLib -Source0: %{pypi_source OWSLib} +%global forgeurl https://github.com/geopython/OWSLib +Source0: %{forgeurl}/archive/%{version}/OWSLib-%{version}.tar.gz + BuildArch: noarch %global common_description %{expand: @@ -24,6 +26,7 @@ Summary: %{summary} BuildRequires: python2-devel BuildRequires: python2-setuptools +BuildRequires: python2-pytest BuildRequires: python2-dateutil BuildRequires: python2-requests @@ -43,6 +46,7 @@ Summary: %{summary} 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 @@ -65,6 +69,9 @@ 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 @@ -76,6 +83,56 @@ find 'owslib' -type f -name '*.py' \ %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 README.txt CHANGES.txt CREDITS.txt @@ -97,6 +154,7 @@ find 'owslib' -type f -name '*.py' \ - 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 * Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 - New upstream release diff --git a/sources b/sources index babaa82..f25b222 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e511e8bdddce0e59abefc892f090e033 OWSLib-0.9.0.tar.gz +SHA512 (OWSLib-0.9.0.tar.gz) = 4367d8de31c07499e450f05d78bded15926ed369963fa59b4372c5e658244d5c244443691dc31a436b26027109d99c827a7daf2d678f92ad41f1f51fe9de48f9 From 55880a3f499ff345f2224bae6b535b20e939f8d3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 08:38:15 -0500 Subject: [PATCH 07/12] Install more text documentation files --- python-OWSLib.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 29ffea4..1c996d6 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -135,7 +135,11 @@ PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ %files -n python2-OWSLib %license LICENSE.txt -%doc README.txt CHANGES.txt CREDITS.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 @@ -143,7 +147,11 @@ PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ %files -n python%{python3_pkgversion}-OWSLib %license LICENSE.txt -%doc README.txt CHANGES.txt CREDITS.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 @@ -155,6 +163,7 @@ PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ - 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 - 0.9.0-1 - New upstream release From 00f04a41f2a15d1a56d5b2fb73d6fde88ae4201c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 08:41:28 -0500 Subject: [PATCH 08/12] Add dependency version bounds --- python-OWSLib.spec | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 1c996d6..aa24d57 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -28,11 +28,11 @@ BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-pytest -BuildRequires: python2-dateutil +BuildRequires: python2-dateutil >= 1.5 BuildRequires: python2-requests BuildRequires: python2-pytz -Requires: python2-dateutil +Requires: python2-dateutil >= 1.5 Requires: python2-requests Requires: python2-pytz @@ -48,12 +48,12 @@ 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}-dateutil >= 1.5 +BuildRequires: python%{python3_pkgversion}-requests >= 2.7 BuildRequires: python%{python3_pkgversion}-pytz -Requires: python%{python3_pkgversion}-dateutil -Requires: python%{python3_pkgversion}-requests +Requires: python%{python3_pkgversion}-dateutil >= 1.5 +Requires: python%{python3_pkgversion}-requests >= 2.7 Requires: python%{python3_pkgversion}-pytz %description -n python%{python3_pkgversion}-OWSLib %{common_description} @@ -164,6 +164,7 @@ PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ - Build the Python 3 sub-package on EPEL7 - Switch to the GitHub source archive and run the offline tests - Install more text documentation files +- Add dependency version bounds * Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 - New upstream release From 249e830c172e6c438270ff8cdaa1bba8811f8439 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 08:42:59 -0500 Subject: [PATCH 09/12] Convert to %autorelease and %autochangelog [skip changelog] --- changelog | 38 ++++++++++++++++++++++++++++++++++++++ python-OWSLib.spec | 41 ++--------------------------------------- 2 files changed, 40 insertions(+), 39 deletions(-) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..f72eb58 --- /dev/null +++ b/changelog @@ -0,0 +1,38 @@ +* Wed Mar 08 2023 Benjamin A. Beasley - 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 +- Add dependency version bounds + +* Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 +- New upstream release +- Add Python 3 sub-package + +* Sat Feb 14 2015 Volker Fröhlich - 0.8.13-1 +- New upstream release + +* Tue Dec 23 2014 Volker Fröhlich - 0.8.12-1 +- New upstream release + +* Wed Dec 17 2014 Volker Fröhlich - 0.8.11-1 +- New upstream release + +* Mon Oct 13 2014 Volker Fröhlich - 0.8.10-1 +- New upstream release + +* Wed Sep 24 2014 Volker Fröhlich - 0.8.9-1 +- New upstream release + +* Mon Jul 7 2014 Volker Fröhlich - 0.8.8-1 +- New upstream release + +* Wed Jul 2 2014 Volker Fröhlich - 0.8.7-3 +- Changed package summary + +* Tue Jul 1 2014 Volker Fröhlich - 0.8.7-2 +- Correct BR python-setuptools-devel to python-setuptools + +* Mon Jun 30 2014 Volker Fröhlich - 0.8.7-1 +- Initial package for Fedora diff --git a/python-OWSLib.spec b/python-OWSLib.spec index aa24d57..d769efb 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -2,7 +2,7 @@ Name: python-OWSLib Version: 0.9.0 -Release: 2%{?dist} +Release: %autorelease Summary: Client library for OGC web services License: BSD-3-Clause @@ -158,41 +158,4 @@ PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ %changelog -* Wed Mar 08 2023 Benjamin A. Beasley - 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 -- Add dependency version bounds - -* Sat Jun 13 2015 Volker Fröhlich - 0.9.0-1 -- New upstream release -- Add Python 3 sub-package - -* Sat Feb 14 2015 Volker Fröhlich - 0.8.13-1 -- New upstream release - -* Tue Dec 23 2014 Volker Fröhlich - 0.8.12-1 -- New upstream release - -* Wed Dec 17 2014 Volker Fröhlich - 0.8.11-1 -- New upstream release - -* Mon Oct 13 2014 Volker Fröhlich - 0.8.10-1 -- New upstream release - -* Wed Sep 24 2014 Volker Fröhlich - 0.8.9-1 -- New upstream release - -* Mon Jul 7 2014 Volker Fröhlich - 0.8.8-1 -- New upstream release - -* Wed Jul 2 2014 Volker Fröhlich - 0.8.7-3 -- Changed package summary - -* Tue Jul 1 2014 Volker Fröhlich - 0.8.7-2 -- Correct BR python-setuptools-devel to python-setuptools - -* Mon Jun 30 2014 Volker Fröhlich - 0.8.7-1 -- Initial package for Fedora +%autochangelog From 050ce07c62ada5da601dec1760df44eb06fa84f8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 08:43:34 -0500 Subject: [PATCH 10/12] Update to 0.9.2 - Drop the Python 3 subpackage (which was never actually built as an update) since pyproj is not available --- .gitignore | 1 + python-OWSLib.spec | 46 +++++++++++++++++++++++++++++++++++++++++----- sources | 2 +- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c3a838b..7c7afe7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /OWSLib-0.8.12.tar.gz /OWSLib-0.8.13.tar.gz /OWSLib-0.9.0.tar.gz +/OWSLib-0.9.2.tar.gz diff --git a/python-OWSLib.spec b/python-OWSLib.spec index d769efb..5c69cf3 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -1,7 +1,10 @@ # Works with either ElementTree or python-lxml +# No pyproj for Python 3 in EPEL7 +%bcond_with python3 + Name: python-OWSLib -Version: 0.9.0 +Version: 0.9.2 Release: %autorelease Summary: Client library for OGC web services @@ -29,16 +32,19 @@ BuildRequires: python2-setuptools BuildRequires: python2-pytest BuildRequires: python2-dateutil >= 1.5 -BuildRequires: python2-requests +BuildRequires: python2-requests >= 1.0 BuildRequires: python2-pytz +BuildRequires: pyproj Requires: python2-dateutil >= 1.5 -Requires: python2-requests +Requires: python2-requests >= 1.0 Requires: python2-pytz +Requires: python2-pyproj %description -n python2-OWSLib %{common_description} +%if %{with python3} %package -n python%{python3_pkgversion}-OWSLib Summary: %{summary} @@ -49,14 +55,17 @@ BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-dateutil >= 1.5 -BuildRequires: python%{python3_pkgversion}-requests >= 2.7 +BuildRequires: python%{python3_pkgversion}-requests >= 1.0 BuildRequires: python%{python3_pkgversion}-pytz +BuildRequires: python%{python3_pkgversion}-pyproj Requires: python%{python3_pkgversion}-dateutil >= 1.5 -Requires: python%{python3_pkgversion}-requests >= 2.7 +Requires: python%{python3_pkgversion}-requests >= 1.0 Requires: python%{python3_pkgversion}-pytz +Requires: python%{python3_pkgversion}-pyproj %description -n python%{python3_pkgversion}-OWSLib %{common_description} +%endif %prep @@ -75,12 +84,16 @@ sed -r -i 's/--cov[^[:blank:]=]*([=[:blank:]][^-][^[:blank:]]+)?//g' tox.ini %build %py2_build +%if %{with python3} %py3_build +%endif %install %py2_install +%if %{with python3} %py3_install +%endif %check @@ -103,7 +116,9 @@ 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_geonetwork and txt)" k="${k-}${k+ and }not (csw_geoserver and txt)" +k="${k-}${k+ and }not (csw_linz 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)" @@ -116,6 +131,7 @@ 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 (wms_getfeatureinfo 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)" @@ -126,11 +142,29 @@ 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)" +# ____________ [doctest] tests/doctests/wms_GeoServerCapabilities.txt ____________ +# 062 >>> x = wms['opengeo:poi'].styles +# 063 >>> x == {'point': {'legend': 'http://localhost:8080/geoserver/wms?request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=poi', 'title': 'A boring default style'}} +# 064 True +# 065 +# 066 Test nested layer +# 067 +# 068 >>> wms['parent_layer'].title +# 069 'Parent Layer' +# 070 +# 071 >>> wms['parent_layer'].queryable +# Expected: +# 1 +# Got: +# 0 +k="${k-}${k+ and } not (wms_GeoServerCapabilities and txt)" PYTHONPATH='%{buildroot}%{python2_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ %{python2} -m pytest -m 'not online' -k "${k-}" +%if %{with python3} PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ %{python3} -m pytest -m 'not online' -k "${k-}" +%endif %files -n python2-OWSLib @@ -145,6 +179,7 @@ PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ %{python2_sitelib}/OWSLib-%{version}-py%{python2_version}.egg-info +%if %{with python3} %files -n python%{python3_pkgversion}-OWSLib %license LICENSE.txt %doc CHANGES.txt @@ -155,6 +190,7 @@ PYTHONPATH='%{buildroot}%{python3_sitelib}' PYTHONDONTWRITEBYTECODE=1 \ %{python3_sitelib}/owslib/ %{python3_sitelib}/OWSLib-%{version}-py%{python3_version}.egg-info +%endif %changelog diff --git a/sources b/sources index f25b222..e64051e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OWSLib-0.9.0.tar.gz) = 4367d8de31c07499e450f05d78bded15926ed369963fa59b4372c5e658244d5c244443691dc31a436b26027109d99c827a7daf2d678f92ad41f1f51fe9de48f9 +SHA512 (OWSLib-0.9.2.tar.gz) = 1818299d702053b344edd435417785c8dd1c4d811a8bff7919c04624cf62a9324c856604965706f0416bea827dab3e5650b1f1cf6730b1b424535673f90e4cf0 From 3a8551e70630c399c5da63dc26bf6bfc5b326cd0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Mar 2023 09:09:29 -0500 Subject: [PATCH 11/12] =?UTF-8?q?Backport=20upstream=20PR#863=20(=E2=80=9C?= =?UTF-8?q?use=20only=20lxml=20for=20XML=20handling=E2=80=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixes CVE-2023-27476 https://nvd.nist.gov/vuln/detail/CVE-2023-27476 - Fixes GHSA-8h9c-r582-mggc https://github.com/geopython/OWSLib/security/advisories/GHSA-8h9c-r582-mggc - Fixes RHBZ#2176417 https://bugzilla.redhat.com/show_bug.cgi?id=2176417 --- 0001-use-only-lxml-for-XML-handling.patch | 232 ++++++++++++++++++++++ python-OWSLib.spec | 13 +- 2 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 0001-use-only-lxml-for-XML-handling.patch diff --git a/0001-use-only-lxml-for-XML-handling.patch b/0001-use-only-lxml-for-XML-handling.patch new file mode 100644 index 0000000..0e5e450 --- /dev/null +++ b/0001-use-only-lxml-for-XML-handling.patch @@ -0,0 +1,232 @@ +From 2f81f2b36c01b2a32e8dcf6b2c695b36b1eb0b8f Mon Sep 17 00:00:00 2001 +From: Tom Kralidis +Date: Fri, 24 Feb 2023 10:15:35 -0500 +Subject: [PATCH] use only lxml for XML handling + +Backport of PR#863 (https://github.com/geopython/OWSLib/pull/863) to 0.9.2 +--- + owslib/etree.py | 58 ++++++++--------------------- + owslib/util.py | 96 ++++++++++++++++++------------------------------ + requirements.txt | 1 + + 3 files changed, 52 insertions(+), 103 deletions(-) + +diff --git a/owslib/etree.py b/owslib/etree.py +index b8babe8..88ae7ab 100644 +--- a/owslib/etree.py ++++ b/owslib/etree.py +@@ -6,9 +6,15 @@ + + from __future__ import (absolute_import, division, print_function) + import six +-import inspect + +-def patch_well_known_namespaces(etree_module): ++from lxml import etree ++from lxml.etree import ParseError ++ElementType = etree._Element ++ ++from owslib.namespaces import Namespaces ++ ++def patch_well_known_namespaces(): ++ """Monkey patches lxml.etree to add some well-known namespaces.""" + + import warnings + from owslib.namespaces import Namespaces +@@ -17,50 +23,18 @@ def patch_well_known_namespaces(etree_module): + """Monkey patches the etree module to add some well-known namespaces.""" + + try: +- register_namespace = etree_module.register_namespace ++ register_namespace = etree.register_namespace + except AttributeError: +- try: +- etree_module._namespace_map ++ etree._namespace_map + +- def register_namespace(prefix, uri): +- etree_module._namespace_map[uri] = prefix +- except AttributeError: +- def register_namespace(prefix, uri): +- pass +- warnings.warn("Only 'lxml.etree' >= 2.3 and 'xml.etree.ElementTree' >= 1.3 are fully supported!") ++ def register_namespace(prefix, uri): ++ etree._namespace_map[uri] = prefix + + for k, v in six.iteritems(ns.get_namespaces()): + register_namespace(k, v) + +-# try to find lxml or elementtree +-try: +- from lxml import etree +- from lxml.etree import ParseError +- ElementType = etree._Element +-except ImportError: +- try: +- # Python 2.x/3.x with ElementTree included +- import xml.etree.ElementTree as etree +- +- try: +- from xml.etree.ElementTree import ParseError +- except ImportError: +- from xml.parsers.expat import ExpatError as ParseError +- +- if hasattr(etree, 'Element') and inspect.isclass(etree.Element): +- # python 3.4, 3.3, 2.7 +- ElementType = etree.Element +- else: +- # python 2.6 +- ElementType = etree._ElementInterface +- +- except ImportError: +- try: +- # Python < 2.5 with ElementTree installed +- import elementtree.ElementTree as etree +- ParseError = StandardError # i can't find a ParseError related item in elementtree docs! +- ElementType = etree.Element +- except ImportError: +- raise RuntimeError('You need either lxml or ElementTree to use OWSLib!') ++ etree.set_default_parser( ++ parser=etree.XMLParser(resolve_entities=False) ++ ) + +-patch_well_known_namespaces(etree) ++patch_well_known_namespaces() +diff --git a/owslib/util.py b/owslib/util.py +index 22bcaa7..51ce6d0 100644 +--- a/owslib/util.py ++++ b/owslib/util.py +@@ -239,11 +239,8 @@ def nspath_eval(xpath, namespaces): + + def cleanup_namespaces(element): + """ Remove unused namespaces from an element """ +- if etree.__name__ == 'lxml.etree': +- etree.cleanup_namespaces(element) +- return element +- else: +- return etree.fromstring(etree.tostring(element)) ++ etree.cleanup_namespaces(element) ++ return element + + + def add_namespaces(root, ns_keys): +@@ -254,35 +251,34 @@ def add_namespaces(root, ns_keys): + + ns_keys = [(x, namespaces.get_namespace(x)) for x in ns_keys] + +- if etree.__name__ != 'lxml.etree': +- # We can just add more namespaces when not using lxml. +- # We can't re-add an existing namespaces. Get a list of current +- # namespaces in use +- existing_namespaces = set() +- for elem in root.getiterator(): +- if elem.tag[0] == "{": +- uri, tag = elem.tag[1:].split("}") +- existing_namespaces.add(namespaces.get_namespace_from_url(uri)) +- for key, link in ns_keys: +- if link is not None and key not in existing_namespaces: +- root.set("xmlns:%s" % key, link) +- return root +- else: +- # lxml does not support setting xmlns attributes +- # Update the elements nsmap with new namespaces +- new_map = root.nsmap +- for key, link in ns_keys: +- if link is not None: +- new_map[key] = link +- # Recreate the root element with updated nsmap +- new_root = etree.Element(root.tag, nsmap=new_map) +- # Carry over attributes +- for a, v in list(root.items()): +- new_root.set(a, v) +- # Carry over children +- for child in root: +- new_root.append(deepcopy(child)) +- return new_root ++ # lxml does not support setting xmlns attributes ++ # Update the elements nsmap with new namespaces ++ new_map = root.nsmap ++ for key, link in ns_keys: ++ if link is not None: ++ new_map[key] = link ++ # Recreate the root element with updated nsmap ++ new_root = etree.Element(root.tag, nsmap=new_map) ++ # Carry over attributes ++ for a, v in list(root.items()): ++ new_root.set(a, v) ++ # Carry over children ++ for child in root: ++ new_root.append(deepcopy(child)) ++ return new_root ++ ++ # We can just add more namespaces when not using lxml. ++ # We can't re-add an existing namespaces. Get a list of current ++ # namespaces in use ++ existing_namespaces = set() ++ for elem in root.iter(): ++ if elem.tag[0] == "{": ++ uri, tag = elem.tag[1:].split("}") ++ existing_namespaces.add(namespaces.get_namespace_from_url(uri)) ++ for key, link in ns_keys: ++ if link is not None and key not in existing_namespaces: ++ root.set("xmlns:%s" % key, link) ++ return root + + + def getXMLInteger(elem, tag): +@@ -401,20 +397,13 @@ def element_to_string(element, encoding=None, xml_declaration=False): + if encoding is None: + encoding = "ISO-8859-1" + +- if etree.__name__ == 'lxml.etree': +- if xml_declaration: +- if encoding in ['unicode', 'utf-8']: +- output = '\n%s' % \ +- etree.tostring(element, encoding='unicode') +- else: +- output = etree.tostring(element, encoding=encoding, xml_declaration=True) ++ if xml_declaration: ++ if encoding in ['unicode', 'utf-8']: ++ output = '\n%s' % \ ++ etree.tostring(element, encoding='unicode') + else: +- output = etree.tostring(element) ++ output = etree.tostring(element, encoding=encoding, xml_declaration=True) + else: +- if xml_declaration: +- output = '\n%s' % (encoding, +- etree.tostring(element, encoding=encoding)) +- else: + output = etree.tostring(element) + + return output +@@ -581,18 +570,3 @@ try: # 2.7 + from collections import OrderedDict + except: # 2.6 + from ordereddict import OrderedDict +- +- +-def which_etree(): +- """decipher which etree library is being used by OWSLib""" +- +- which_etree = None +- +- if 'lxml' in etree.__file__: +- which_etree = 'lxml.etree' +- elif 'xml/etree' in etree.__file__: +- which_etree = 'xml.etree' +- elif 'elementree' in etree.__file__: +- which_etree = 'elementtree.ElementTree' +- +- return which_etree +diff --git a/requirements.txt b/requirements.txt +index 7689a61..10ad5db 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1,3 +1,4 @@ ++lxml + python-dateutil>=1.5 + pytz + requests>=1.0 +-- +2.39.2 + diff --git a/python-OWSLib.spec b/python-OWSLib.spec index 5c69cf3..e058d1f 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -13,6 +13,13 @@ URL: http://geopython.github.io/OWSLib %global forgeurl https://github.com/geopython/OWSLib Source0: %{forgeurl}/archive/%{version}/OWSLib-%{version}.tar.gz +# use only lxml for XML handling +# Backport of PR#863 (https://github.com/geopython/OWSLib/pull/863) to 0.9.2 +# Fixes: CVE-2023-27476 https://nvd.nist.gov/vuln/detail/CVE-2023-27476 +# GHSA-8h9c-r582-mggc https://github.com/geopython/OWSLib/security/advisories/GHSA-8h9c-r582-mggc +# RHBZ#2176417 https://bugzilla.redhat.com/show_bug.cgi?id=2176417 +Patch0: 0001-use-only-lxml-for-XML-handling.patch + BuildArch: noarch %global common_description %{expand: @@ -35,11 +42,13 @@ BuildRequires: python2-dateutil >= 1.5 BuildRequires: python2-requests >= 1.0 BuildRequires: python2-pytz BuildRequires: pyproj +BuildRequires: python-lxml Requires: python2-dateutil >= 1.5 Requires: python2-requests >= 1.0 Requires: python2-pytz Requires: python2-pyproj +Requires: python-lxml %description -n python2-OWSLib %{common_description} @@ -58,18 +67,20 @@ BuildRequires: python%{python3_pkgversion}-dateutil >= 1.5 BuildRequires: python%{python3_pkgversion}-requests >= 1.0 BuildRequires: python%{python3_pkgversion}-pytz BuildRequires: python%{python3_pkgversion}-pyproj +BuildRequires: python%{python3_pkgversion}-lxml Requires: python%{python3_pkgversion}-dateutil >= 1.5 Requires: python%{python3_pkgversion}-requests >= 1.0 Requires: python%{python3_pkgversion}-pytz Requires: python%{python3_pkgversion}-pyproj +Requires: python%{python3_pkgversion}-lxml %description -n python%{python3_pkgversion}-OWSLib %{common_description} %endif %prep -%autosetup -n OWSLib-%{version} +%autosetup -n OWSLib-%{version} -p1 rm -rf OWSLib.egg-info # Remove shebangs from non-script sources. The find-then-modify pattern From 7d275864c0277c3420d9b485e09c57c351ebdce7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 25 Aug 2023 11:07:36 -0400 Subject: [PATCH 12/12] Fix broken runtime pyproj dependency (fix RHBZ#2234805) --- python-OWSLib.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-OWSLib.spec b/python-OWSLib.spec index e058d1f..6f40df5 100644 --- a/python-OWSLib.spec +++ b/python-OWSLib.spec @@ -47,7 +47,7 @@ BuildRequires: python-lxml Requires: python2-dateutil >= 1.5 Requires: python2-requests >= 1.0 Requires: python2-pytz -Requires: python2-pyproj +Requires: pyproj Requires: python-lxml %description -n python2-OWSLib %{common_description}