%global pypi_name pyshacl Name: python-pyshacl Version: 0.26.0 Release: %autorelease Summary: Python validator for SHACL License: Apache-2.0 URL: https://github.com/RDFLib/pySHACL Source: %{url}/archive/v%{version}/pyshacl-%{version}.tar.gz # We relax the poetry-core dependency to 1.8.1 to build on F40 # Drop when F40 is not supported anymore # Also remove extra spec file for win32 cli, keep ths one. Patch: 0001-Relax-poetry-core-dependency.patch BuildArch: noarch BuildRequires: fdupes BuildRequires: help2man BuildRequires: python3-devel BuildRequires: python3dist(pytest) %global _description %{expand: This is a pure Python module which allows for the validation of RDF graphs against Shapes Constraint Language (SHACL) graphs. This module uses the rdflib Python library for working with RDF and is dependent on the OWL-RL Python module for OWL2 RL Profile based expansion of data graphs.} %description %_description %package -n python3-pyshacl Summary: %{summary} %description -n python3-pyshacl %_description # %%pyproject_extras_subpkg -n python3-pyshacl http %prep %autosetup -p1 -n pySHACL-%{version} %generate_buildrequires %pyproject_buildrequires -t # -x http %build %pyproject_wheel %install %pyproject_install mkdir -p %{buildroot}%{_mandir}/man1/ %py3_test_envvars help2man --no-discard-stderr pyshacl -o %{buildroot}%{_mandir}/man1/pyshacl.1 # %%py3_test_envvars help2man --no-discard-stderr pyshacl_server -o %%{buildroot}%%{_mandir}/man1/pyshacl_server.1 %py3_test_envvars help2man --no-discard-stderr pyshacl_validate -o %{buildroot}%{_mandir}/man1/pyshacl_validate.1 # pyshacl_server needs -x http to work, with python-sanic and python-sanic-ext # which are not packaged. # (python3dist(sanic) < 23~~ with python3dist(sanic) >= 22.12) # (python3dist(sanic-ext) < 23.6~~ with python3dist(sanic-ext) >= 23.3) rm -rfv %{buildroot}%{_bindir}/pyshacl_server # Fix permissions chmod +x %{buildroot}%{python3_sitelib}/pyshacl/cli.py # remove duplicate md files pushd %{buildroot}%{python3_sitelib} rm -rfv CHANGELOG.md \ CONTRIBUTING.md \ CONTRIBUTORS.md \ FEATURES.md \ LICENSE.txt \ README.md popd %pyproject_save_files -L pyshacl # Deduplicate, the binaries are identical, they script use arg0 to determine # the function to run. %fdupes %{buildroot}%{_bindir} %fdupes %{buildroot}%{python3_sitelib} %check # Disable network dependent tests # Disable test_js depending on not packaged pyduktape2 %pytest -k "not test_cmdline_web and not test_cmdline_jsonld and not \ test_web_retrieve and not test_web_retrieve_fail and not \ test_owl_imports and not test_owl_imports_fail and not \ test_98 and not test_108 and not test_154 and not test_js" %files -n python3-pyshacl -f %{pyproject_files} %license LICENSE.txt %doc CHANGELOG.md CONTRIBUTING.md CONTRIBUTORS.md FEATURES.md README.md %{_bindir}/pyshacl # %%{_bindir}/pyshacl_server %{_bindir}/pyshacl_validate %{_mandir}/man1/pyshacl*.1* %changelog %autochangelog