Compare commits

...
Sign in to create a new pull request.

15 commits

Author SHA1 Message Date
Benjamin A. Beasley
8e5b25853d Omit test data files with unclear license status 2024-11-13 11:45:47 -05:00
Benjamin A. Beasley
bc03da935e Update Summary from upstream 2024-11-13 11:32:31 -05:00
Benjamin A. Beasley
0fd1e39356 Add an rpmlintrc file
[skip changelog]
2024-11-13 11:32:29 -05:00
Benjamin A. Beasley
71e490867f Shorten a long line by using a macro
[skip changelog]
2024-11-13 11:32:07 -05:00
Benjamin A. Beasley
c5c9d4bcf7 Don’t assume %_smp_mflags is -j%_smp_build_ncpus 2024-11-13 11:31:31 -05:00
Benjamin A. Beasley
12b6628c31 Move some text doc files to the -doc subpackage 2024-11-13 11:31:14 -05:00
Benjamin A. Beasley
1e02ad4b8a Update to 0.28.1 (close RHBZ#2173195) 2023-02-25 09:54:33 -05:00
Benjamin A. Beasley
cf33f09c37 Update to 0.28.0 (close RHBZ#2171409) 2023-02-20 20:11:57 -05:00
Benjamin A. Beasley
e98c04ef0f Update to 0.27.2 (close RHBZ#2122000) 2022-08-29 08:35:04 -04:00
Benjamin A. Beasley
c307c40e2c Update License to SPDX 2022-08-29 08:34:34 -04:00
Benjamin A. Beasley
34bc5e69e2 Fix a typo in a spec file comment 2022-08-29 08:34:29 -04:00
Benjamin A. Beasley
c956583dc2 Fix extra newline in description 2022-08-29 08:34:19 -04:00
Benjamin A. Beasley
26d11c7309 Fix FTBFS due to Python 3.8 confusion
Since Python 3.8 and Python 3.6 packages are both providing
python3dist(…), BuildRequires of this form have become broken.
2022-07-28 22:10:47 -04:00
Benjamin A. Beasley
789902c413 Update to 0.26.0 (close RHBZ#2095806) 2022-06-10 14:43:55 -04:00
Benjamin A. Beasley
a9e0873869 Backport to EPEL8 (close RHBZ#1974684) 2021-12-23 11:44:58 -05:00
5 changed files with 254 additions and 72 deletions

6
.gitignore vendored
View file

@ -26,3 +26,9 @@
/OWSLib-0.20.0.tar.gz
/OWSLib-0.21.0.tar.gz
/OWSLib-0.25.0.tar.gz
/OWSLib-0.26.0.tar.gz
/OWSLib-0.27.2.tar.gz
/OWSLib-0.28.0.tar.gz
/OWSLib-0.28.1.tar.gz
/OWSLib-0.28.1-filtered.tar.zst
/OWSLib-0.28.1-filtered.tar.xz

63
get_source Executable file
View file

@ -0,0 +1,63 @@
#!/bin/sh
set -o nounset
set -o errexit
FORGEURL='https://github.com/geopython/OWSLib'
print_help()
{
cat <<EOF
Usage: $1 VERSION
Generate a source archive for OWSLib with questionably-licensed XML files in
tests/resources/ removed. The result will be named
OWSLib-\${VERSION}-filtered.tar.xz and will be written into the current
working directory.
EOF
}
if [ "$#" != '1' ]
then
exec 1>&2
print_help "${0}"
exit 1
elif [ "${1-}" = '-h' ] || [ "${1-}" = '--help' ]
then
print_help "${0}"
exit 0
fi
VERSION="${1}"
SOURCE0="${FORGEURL}/archive/${VERSION}/OWSLib-${VERSION}.tar.gz"
TARNAME="$(basename "${SOURCE0}")"
TARDIR="$(basename "${SOURCE0}" '.tar.gz')"
NEWTAR="${TARDIR}-filtered.tar.xz"
SAVEDIR="${PWD}"
XDIR="$(mktemp -d)"
trap "rm -rf '${XDIR}'" INT TERM EXIT
cd "${XDIR}"
curl -L -O "${SOURCE0}"
echo "Extracting ${TARNAME}…" 1>&2
tar -xzf "${TARNAME}"
MTIME="$(stat -c '%Y' "${TARDIR}")"
rm -rvf "${TARDIR}/tests/resources"
echo "Re-compressing as ${NEWTAR}…" 1>&2
# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
# We reset all mtimes to that of the top-level extracted directory; since git
# archives dont have meaningful per-file mtimes, nothing useful is lost.
TZ=UTC LC_ALL=C tar \
--create \
--sort=name \
--format=posix \
--numeric-owner --owner=0 --group=0 \
--mode=go+u,go-w \
--pax-option='delete=atime,delete=ctime' \
--clamp-mtime --mtime="@${MTIME}" \
"${TARDIR}/" |
xz -9 -e > "${NEWTAR}"
touch -d @"${MTIME}" "${NEWTAR}"
cd "${SAVEDIR}"
mv -v "${XDIR}/${NEWTAR}" .

2
python-OWSLib.rpmlintrc Normal file
View file

@ -0,0 +1,2 @@
# All documentation is in the -doc subpackage.
addFilter(r" no-documentation$")

View file

@ -1,30 +1,79 @@
# 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.
%bcond_without doc_pdf
# We can generate PDF documentation as a substitute. However, most of the
# necessary dependencies are not packaged for EPEL8 and probably never will be.
%bcond_with doc_pdf
# Tests require pytest >= 3.8 but EPEL8 has 3.4.2.
%bcond_with tests
Name: python-OWSLib
Version: 0.25.0
Version: 0.28.1
Release: %autorelease
Summary: Client library for OGC web services
Summary: OGC Web Service utility library
License: BSD
License: BSD-3-Clause
URL: https://geopython.github.io/OWSLib
Source0: https://github.com/geopython/OWSLib/archive/%{version}/OWSLib-%{version}.tar.gz
# 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.xz
Source1: get_source
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python%{python3_pkgversion}-devel
# requirements.txt:
BuildRequires: python%{python3_pkgversion}-dateutil >= 1.5
BuildRequires: python%{python3_pkgversion}-pytz
BuildRequires: python%{python3_pkgversion}-requests >= 1.0
BuildRequires: python%{python3_pkgversion}-pyproj >= 2
BuildRequires: python%{python3_pkgversion}-pyyaml
BuildRequires: python%{python3_pkgversion}-lxml
# python_version < '3.7':
BuildRequires: python%{python3_pkgversion}-dataclasses
# requirements-dev.txt
# flake8
# pytest-cov
# twine
# wheel
# coverage
# coveralls
# tox
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest >= 3.8
%endif
%if %{with doc_pdf}
BuildRequires: make
BuildRequires: python3-sphinx-latex
BuildRequires: python%{python3_pkgversion}-sphinx-latex
BuildRequires: latexmk
BuildRequires: pandoc
# requirements-dev.txt
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-Pillow
BuildRequires: python%{python3_pkgversion}-nbsphinx
BuildRequires: python%{python3_pkgversion}-ipykernel
BuildRequires: python%{python3_pkgversion}-nbconvert
BuildRequires: python%{python3_pkgversion}-pandoc
%endif
%global common_description %{expand: \
%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.
@ -34,39 +83,33 @@ 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}
%description %{common_description}
%package -n python3-OWSLib
%package -n python%{python3_pkgversion}-OWSLib
Summary: %{summary}
%description -n python3-OWSLib
%{common_description}
%py_provides python%{python3_pkgversion}-OWSLib
%py_provides python%{python3_pkgversion}-owslib
%description -n python%{python3_pkgversion}-OWSLib %{common_description}
%package doc
Summary: Documentation and examples for OWSLib
%description doc
%{summary}.
%description doc %{common_description}
This package contains documentation and examples for OWSLib.
%prep
%autosetup -n OWSLib-%{version}
%if %{with tests}
# Dont analyze/report test coverage
sed -r -i 's/[-]-cov[^[:blank:]]*[[:blank:]][^[[:blank:]]+//g' tox.ini
# Dont generate linting/coverage dependencies.
#
# We dont have python3dist(pandoc) packaged, and besides, we dont actually
# need python3dist(pandoc)—only the pandoc command-line tool, which we have
# manually BRd.
#
# Dont generate twine dependency, which is just for the upstream maintainer
# uploading to PyPI.
sed -r '/^(flake8|pytest-cov|pandoc|coverage|coveralls|twine)\b/d' \
requirements-dev.txt > requirements-dev-filtered.txt
%endif
# We dont need shebangs in the examples. The pattern of selecting files
# before modifying them with sed keeps us from unnecessarily discarding the
@ -82,74 +125,142 @@ chmod -v a-x examples/*.py
echo 'nbsphinx_allow_errors = True' >> docs/conf.py
%generate_buildrequires
%pyproject_buildrequires -r requirements-dev-filtered.txt
%build
%pyproject_wheel
%py3_build
%if %{with doc_pdf}
PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
PYTHONPATH="${PWD}" %make_build -C docs latex \
SPHINXOPTS='-j%{?_smp_build_ncpus}'
%make_build -C docs/build/latex/en LATEXMKOPTS='-quiet'
%endif
%install
%pyproject_install
%pyproject_save_files owslib
%py3_install
%check
%if %{with tests}
# Otherwise, pytest finds the package twice in the Python path and complains.
rm -rf owslib
# 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.txt"
k="${k-}${k+ and }not wfs_MapServerWFSFeature.txt"
k="${k-}${k+ and }not wfs_MapServerWFSCapabilities.txt"
k="${k-}${k+ and }not wfs2_storedqueries.txt"
k="${k-}${k+ and }not wfs1_generic.txt"
k="${k-}${k+ and }not wcs_thredds.txt"
# 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"
# Not in 0.30.0:
k="${k-}${k+ and }not test_wmts_example_informatievlaanderen"
# This is a trivial error where the representation of the expected TypeEror has
# changed over time:
# Differences (unified diff with -expected +actual):
# @@ -1,3 +1,6 @@
# Traceback (most recent call last):
# -...
# -TypeError: get_namespace() ...
# + File "/usr/lib64/python3.10/doctest.py", line 1346, in __run
# + exec(compile(example.source, filename, "single",
# + File "<doctest namespaces.txt[15]>", line 1, in <module>
# + ns.get_namespace()
# +TypeError: Namespaces.get_namespace() missing 1 required positional argument: 'key'
k="${k-}${k+ and }not namespaces.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_all)"
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)"
%pytest -m 'not online' -k "${k-}"
PYTHONPATH='%{buildroot}%{python3_sitelib}' '%{python3}' -m pytest \
-m 'not online' -k "${k-}" ${ignore-} -v -rs
%else
%{py3_check_import owslib
owslib
owslib.coverage
owslib.coverage.wcs100
owslib.coverage.wcs110
owslib.coverage.wcs111
owslib.coverage.wcs200
owslib.coverage.wcs201
owslib.coverage.wcsBase
owslib.coverage.wcsdecoder
owslib.crs
owslib.csw
owslib.dif
owslib.etree
owslib.feature
owslib.feature.common
owslib.feature.postrequest
owslib.feature.schema
owslib.feature.wfs100
owslib.feature.wfs110
owslib.feature.wfs200
owslib.fes
owslib.fgdc
owslib.gm03
owslib.interfaces
owslib.iso
owslib.iso_che
owslib.map
owslib.map.common
owslib.map.wms111
owslib.map.wms130
owslib.namespaces
owslib.ogcapi
owslib.ogcapi.coverages
owslib.ogcapi.features
owslib.ogcapi.records
owslib.ows
owslib.owscontext
owslib.owscontext.atom
owslib.owscontext.common
owslib.owscontext.core
owslib.owscontext.geojson
owslib.sos
owslib.swe
owslib.swe.common
owslib.swe.observation
owslib.swe.observation.om
owslib.swe.observation.sos100
owslib.swe.observation.sos200
owslib.swe.observation.waterml2
owslib.swe.sensor
owslib.swe.sensor.sml
owslib.tms
owslib.util
owslib.waterml
owslib.waterml.wml
owslib.waterml.wml10
owslib.waterml.wml11
owslib.wcs
owslib.wfs
owslib.wmc
owslib.wms
owslib.wmts
owslib.wps}
%endif
%files -n python3-OWSLib -f %{pyproject_files}
# pyproject_files handles LICENSE; verify with “rpm -qL -p …”
%files -n python%{python3_pkgversion}-OWSLib
%license LICENSE
%doc AUTHORS.rst
%doc CHANGES.rst
%doc README.rst
%{python3_sitelib}/owslib
%{python3_sitelib}/OWSLib-%{version}-py%{python3_version}.egg-info
%files doc
%license LICENSE
%doc AUTHORS.rst
%doc CHANGES.rst
%doc README.rst
%doc examples
%if %{with doc_pdf}
%doc docs/build/latex/en/OWSLib.pdf

View file

@ -1 +1 @@
SHA512 (OWSLib-0.25.0.tar.gz) = 058108cf77197ce24793608869d56bf0467230f5f231ac9ba48445f2e02d07ea1e26be03ad6967504a1e625008ae2768ed2a663f3b7a49dcea410ee4a8b40cec
SHA512 (OWSLib-0.28.1-filtered.tar.xz) = cc83e5973adb6d6bd5aa624017a6f7927957979f69a3dbdda1645c2ecb8b9b84bbb03b794440c7d66062d365400502a6176514f0fb8d51b8f06b1aea32c0284d