Update to 7.0.0

- Use current Python macros
- Run tests
- Build docs
epel10
Robert-André Mauchin 7 months ago
parent c9fa0bf1db
commit bef7adc9ea

1
.gitignore vendored

@ -8,3 +8,4 @@ rdflib-2.4.2.tar.gz
/rdflib-4.2.1.tar.gz /rdflib-4.2.1.tar.gz
/rdflib-5.0.0.tar.gz /rdflib-5.0.0.tar.gz
/rdflib-6.2.0.tar.gz /rdflib-6.2.0.tar.gz
/rdflib-7.0.0.tar.gz

@ -1,22 +1,33 @@
%global srcname rdflib %global srcname rdflib
# Tests not compatible with pytest 5+: %bcond docs 0
%global run_tests 0 %bcond tests 0
%if 0%{?fedora}
%bcond docs 1
%bcond tests 1
%endif
Name: python-%{srcname} Name: python-%{srcname}
Version: 6.2.0 Version: 7.0.0
Release: %autorelease Release: %autorelease
Summary: Python library for working with RDF Summary: Python library for working with RDF
License: BSD-3-Clause License: BSD-3-Clause
URL: https://github.com/RDFLib/rdflib URL: https://github.com/RDFLib/rdflib
BuildArch: noarch BuildArch: noarch
Source0: %{pypi_source} Source: %{pypi_source}
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools %if %{with tests}
BuildRequires: python3dist(pytest)
%{?python_enable_dependency_generator} %endif
%if %{with docs}
BuildRequires: python3dist(myst-parser)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-autodoc-typehints)
BuildRequires: python3dist(sphinxcontrib-apidoc)
BuildRequires: python3dist(typing-extensions)
%endif
%description %description
RDFLib is a pure Python package for working with RDF. RDFLib contains most RDFLib is a pure Python package for working with RDF. RDFLib contains most
@ -39,21 +50,25 @@ store implementations for in-memory, persistent on disk (Berkeley DB) and
remote SPARQL endpoints, a SPARQL 1.1 implementation - supporting SPARQL 1.1 remote SPARQL endpoints, a SPARQL 1.1 implementation - supporting SPARQL 1.1
Queries and Update statements - and SPARQL function extension mechanisms. Queries and Update statements - and SPARQL function extension mechanisms.
%if %{with docs}
%package -n python%{python3_pkgversion}-%{srcname}-docs
Summary: Documentation for %{srcname}
%description -n python%{python3_pkgversion}-%{srcname}-docs
Documentation for %{srcname}, a Python library for working with RDF.
%endif
%prep %prep
%autosetup -p1 -n %{srcname}-%{version} %autosetup -p1 -n %{srcname}-%{version}
%generate_buildrequires %generate_buildrequires
%if %{run_tests}
%pyproject_buildrequires -x tests
%else
%pyproject_buildrequires %pyproject_buildrequires
%endif
%build %build
%py3_build %pyproject_wheel
%install %install
%py3_install %pyproject_install
# Various .py files within site-packages have a shebang line but aren't # Various .py files within site-packages have a shebang line but aren't
# flagged as executable. # flagged as executable.
@ -63,19 +78,14 @@ Queries and Update statements - and SPARQL function extension mechanisms.
# __main__ parses URI as N-Triples: # __main__ parses URI as N-Triples:
chmod +x %{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/ntriples.py chmod +x %{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/ntriples.py
# __main__ parses the file given on the command line:
chmod +x %{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/notation3.py
# __main__ parses the file or URI given on the command line: # __main__ parses the file or URI given on the command line:
chmod +x %{buildroot}%{python3_sitelib}/rdflib/tools/rdfpipe.py chmod +x %{buildroot}%{python3_sitelib}/rdflib/tools/rdfpipe.py
# __main__ runs a test (well, it's something) # __main__ runs a test (well, it's something)
chmod +x %{buildroot}%{python3_sitelib}/rdflib/extras/infixowl.py \ chmod +x %{buildroot}%{python3_sitelib}/rdflib/extras/external_graph_libs.py
%{buildroot}%{python3_sitelib}/rdflib/extras/external_graph_libs.py
# sed these headers out as they include no __main__ # sed these headers out as they include no __main__
for lib in %{buildroot}%{python3_sitelib}/rdflib/extras/describer.py \ for lib in %{buildroot}%{python3_sitelib}/rdflib/extras/describer.py; do
%{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/pyRdfa/extras/httpheader.py; do
sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new && sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
touch -r $lib $lib.new && touch -r $lib $lib.new &&
mv $lib.new $lib mv $lib.new $lib
@ -89,21 +99,38 @@ sed -i '1s=^#!/usr/bin/\(python\|env python\).*=#!%{__python3}=' \
%{buildroot}%{python3_sitelib}/rdflib/tools/rdfpipe.py \ %{buildroot}%{python3_sitelib}/rdflib/tools/rdfpipe.py \
%{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/notation3.py %{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/notation3.py
%if %{with docs}
# generate html docs
PYTHONPATH=%{buildroot}%{python3_sitelib} sphinx-build-3 -b html -d docs/_build/doctree docs docs/_build/html
# remove the sphinx-build-3 leftovers
rm -rf docs/_build/html/.{doctrees,buildinfo}
%endif
%pyproject_save_files -L %{srcname}
%if %{with tests}
%check %check
%if %{run_tests} %pytest -k "not rdflib and not rdflib.extras.infixowl and not \
%{__python3} -m pytest test_example and not test_suite and not \
test_infix_owl_example1 and not test_context and not \
test_service and not test_simple_not_null and not \
test_sparqleval and not test_parser"
%endif %endif
%files -n python3-%{srcname} %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files}
%license LICENSE %license LICENSE
%doc CHANGELOG.md README.md %doc README.md
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
%{_bindir}/csv2rdf %{_bindir}/csv2rdf
%{_bindir}/rdf2dot %{_bindir}/rdf2dot
%{_bindir}/rdfgraphisomorphism %{_bindir}/rdfgraphisomorphism
%{_bindir}/rdfpipe %{_bindir}/rdfpipe
%{_bindir}/rdfs2dot %{_bindir}/rdfs2dot
%if %{with docs}
%files -n python%{python3_pkgversion}-%{srcname}-docs
%license LICENSE
%doc docs/_build/html
%endif
%changelog %changelog
%autochangelog %autochangelog

@ -1 +1 @@
SHA512 (rdflib-6.2.0.tar.gz) = 7fee5f6df19642ee49039c9072ebc7a9f92bb00f2b5854a7221aba203b32555ff16ec19b76ba86aed1471ee5c5cd8264ade2147435011795b1abf251d1c1bec6 SHA512 (rdflib-7.0.0.tar.gz) = 56d110ab24c74c6ddb2e75320f60a82b4945e6ea1ce9d10ad4ae53d44c679b35826e3d7406e7d0e321ef9b042d32d2ba327a6dbd5c2c1780f552131d80c09445

Loading…
Cancel
Save