# Not yet in EPEL10: https://bugzilla.redhat.com/show_bug.cgi?id=2324280 %bcond pytest_httpserver 0 Name: python-OWSLib Version: 0.35.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 # 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 and examples for OWSLib %description doc %{summary}. %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 -l owslib %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 -n python3-OWSLib -f %{pyproject_files} %doc README.md %files doc %license LICENSE %doc README.md %doc examples/ %changelog %autochangelog