diff --git a/OWSLib-0.35.0-filtered.tar.zst b/OWSLib-0.35.0-filtered.tar.zst new file mode 100644 index 0000000000000000000000000000000000000000..1bdef98a8262de5c1718ca856abecdfb3632b9dc Binary files /dev/null and b/OWSLib-0.35.0-filtered.tar.zst differ diff --git a/get_source b/get_source new file mode 100755 index 0000000000000000000000000000000000000000..085fbb8678aaaf0bdbfa9ffa95fdde6dbaefb468 --- /dev/null +++ b/get_source @@ -0,0 +1,63 @@ +#!/bin/sh +set -o nounset +set -o errexit + +FORGEURL='https://github.com/geopython/OWSLib' + +print_help() +{ + cat <&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.zst" + +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 don’t 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}/" | + zstdmt --ultra -22 > "${NEWTAR}" +touch -d @"${MTIME}" "${NEWTAR}" + +cd "${SAVEDIR}" +mv -v "${XDIR}/${NEWTAR}" . diff --git a/python-OWSLib.spec b/python-OWSLib.spec new file mode 100644 index 0000000000000000000000000000000000000000..6d6b0e02839029a2bf2423f790e64559481389d1 --- /dev/null +++ b/python-OWSLib.spec @@ -0,0 +1,185 @@ +%define anolis_release 1 +%bcond pytest_httpserver 0 + +Name: python-OWSLib +Version: 0.35.0 +Release: %{anolis_release}%{?dist} +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 + +# Tests; dependencies are in requirements-dev.txt. +BuildRequires: %{py3_dist pytest} +%if %{with pytest_httpserver} +BuildRequires: %{py3_dist pytest_httpserver} +%endif +BuildRequires: %{py3_dist Pillow} +# We don’t have pytest-socket packaged, and we can get by without it. +# - pytest-socket +# We don’t use tox to run the tests. It would run "python3 setup.py develop", +# which is unwanted. +# - tox +# Unwanted linting/coverage dependencies: +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters +# - coverage +# - coveralls +# - flake8 +# - pytest-cov +# These are just for the maintainer to upload to PyPI. +# - build +# - twine + +%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 files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + + +%prep +%autosetup -n OWSLib-%{version} + +# Don’t analyze/report test coverage +sed -r -i 's/^([[:blank:]]*)(--cov\b)/\1# \2/' tox.ini + +# 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 + + +%generate_buildrequires +%pyproject_buildrequires + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files owslib +%generate_compatibility_deps + +%check +# Otherwise, pytest finds the package twice in the Python path and complains. +rm -rf owslib + +# 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" + +%if %{without pytest_httpserver} +ignore="${ignore-} --ignore=tests/test_csw_inspire.py" +%endif + +%pytest -m 'not online' -k "${k-}" ${ignore-} -v -rs + +%files doc +%license LICENSE +%doc README.md +%doc examples/ + +%files -n python3-OWSLib -f %{pyproject_files} +%dir %{abidir} + + +%changelog +* Fri Apr 17 2026 Yuki Zhu - 0.35.0-1 +- Init Package from upstream