From 2309564ce57d5ddb2001a53f4b8c7004942581dc37b617bcd56ddb03ad16a8cc Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 27 Feb 2024 06:24:29 +0000 Subject: [PATCH 1/5] - Update to 7.0.0: * BREAKING CHANGE: drop support for python 3.7 (#2436) * feat: add curie method to NamespaceManager (#2365) * feat: add optional target_graph argument to Graph.cbd and use it for DESCRIBE queries (#2322) * feat: Don't generate prefixes for unknown URIs (#2467) * feat: Longturtle improvements (#2500) * fix: SPARQL count with optionals (#2448) * fix: GROUP_CONCAT handling of empty separator (issue) (#2474) * fix: add NORMALIZE_LITERALS to rdflib.__all__ (#2489) * fix: correct imports and __all__ (#2340) * fix: dbpedia URL to use https instead of http (#2444) * fix: eliminate bare except: (#2350) * fix: eliminate some mutable default arguments in SPARQL code (#2301) * fix: formatting of SequencePath and AlternativePath (#2504) * fix: handling of rdf:HTML literals (#2490) * fix: HTTP 308 Permanent Redirect status code handling (#2389) * fix: lexical-to-value mapping of rdf:HTML literals (#2483) * fix: TriG handling of GRAPH keyword without a graph ID (#2469) * fix: TriG parser error handling for nested graphs (#2468) - Switch to autosetup and pyproject macros. - Shift docs build to the install phase, the module needs to be queryable. - Drop patch reproducible.patch, included. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=63 --- python-rdflib.changes | 27 +++++++++++++++++++++++++++ python-rdflib.spec | 34 +++++++++++++++++++--------------- rdflib-6.1.1.tar.gz | 3 --- rdflib-7.0.0.tar.gz | 3 +++ reproducible.patch | 35 ----------------------------------- 5 files changed, 49 insertions(+), 53 deletions(-) delete mode 100644 rdflib-6.1.1.tar.gz create mode 100644 rdflib-7.0.0.tar.gz delete mode 100644 reproducible.patch diff --git a/python-rdflib.changes b/python-rdflib.changes index 606d54f..77366ea 100644 --- a/python-rdflib.changes +++ b/python-rdflib.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Tue Feb 27 06:23:55 UTC 2024 - Steve Kowalik + +- Update to 7.0.0: + * BREAKING CHANGE: drop support for python 3.7 (#2436) + * feat: add curie method to NamespaceManager (#2365) + * feat: add optional target_graph argument to Graph.cbd and use it for + DESCRIBE queries (#2322) + * feat: Don't generate prefixes for unknown URIs (#2467) + * feat: Longturtle improvements (#2500) + * fix: SPARQL count with optionals (#2448) + * fix: GROUP_CONCAT handling of empty separator (issue) (#2474) + * fix: add NORMALIZE_LITERALS to rdflib.__all__ (#2489) + * fix: correct imports and __all__ (#2340) + * fix: dbpedia URL to use https instead of http (#2444) + * fix: eliminate bare except: (#2350) + * fix: eliminate some mutable default arguments in SPARQL code (#2301) + * fix: formatting of SequencePath and AlternativePath (#2504) + * fix: handling of rdf:HTML literals (#2490) + * fix: HTTP 308 Permanent Redirect status code handling (#2389) + * fix: lexical-to-value mapping of rdf:HTML literals (#2483) + * fix: TriG handling of GRAPH keyword without a graph ID (#2469) + * fix: TriG parser error handling for nested graphs (#2468) +- Switch to autosetup and pyproject macros. +- Shift docs build to the install phase, the module needs to be queryable. +- Drop patch reproducible.patch, included. + ------------------------------------------------------------------- Wed Dec 13 08:40:59 UTC 2023 - Bernhard Wiedemann diff --git a/python-rdflib.spec b/python-rdflib.spec index 911aeea..e3709bb 100644 --- a/python-rdflib.spec +++ b/python-rdflib.spec @@ -1,7 +1,7 @@ # # spec file for package python-rdflib # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,31 +16,34 @@ # -%{?!python_module:%define python_module() python3-%{**}} # Tests don't work and cause a dependency loop with python-SPARQLWrapper %bcond_with tests Name: python-rdflib -Version: 6.1.1 +Version: 7.0.0 Release: 0 Summary: A Python library for working with RDF License: BSD-3-Clause URL: http://rdflib.net/ Source: https://files.pythonhosted.org/packages/source/r/rdflib/rdflib-%{version}.tar.gz -Patch0: reproducible.patch +BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module html5lib} BuildRequires: %{python_module isodate} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module poetry} BuildRequires: %{python_module pyparsing} -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: %{python_module xml} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx +BuildRequires: python3-myst-parser +BuildRequires: python3-sphinx-autodoc-typehints BuildRequires: python3-sphinxcontrib-apidoc Requires: python-html5lib Requires: python-isodate Requires: python-pyparsing Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %if %{with tests} BuildRequires: %{python_module SPARQLWrapper} @@ -66,22 +69,23 @@ parser/serializer that conforms to the RDF/XML Syntax Specification (Revised). The library also contains both in-memory and persistent Graph backends. %prep -%setup -q -n rdflib-%{version} -%patch0 -p1 +%autosetup -p1 -n rdflib-%{version} # remove unwanted shebang find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }' %build -%python_build +%pyproject_wheel +%install +%pyproject_install + +# Build the docs, we need the module queryable pushd docs -%make_build html +PYTHONPATH=%{buildroot}%{python3_sitelib} %make_build html # Remove hidden file rm -r _build/html/.buildinfo popd -%install -%python_install %python_clone -a %{buildroot}%{_bindir}/rdfs2dot %python_clone -a %{buildroot}%{_bindir}/rdfpipe %python_clone -a %{buildroot}%{_bindir}/rdfgraphisomorphism @@ -112,14 +116,14 @@ popd %files %{python_files} %license LICENSE -%doc CHANGELOG.md CONTRIBUTORS README.md +%doc README.md %python_alternative %{_bindir}/csv2rdf %python_alternative %{_bindir}/rdf2dot %python_alternative %{_bindir}/rdfgraphisomorphism %python_alternative %{_bindir}/rdfpipe %python_alternative %{_bindir}/rdfs2dot -%{python_sitelib}/rdflib/ -%{python_sitelib}/rdflib-%{version}-py*.egg-info +%{python_sitelib}/rdflib +%{python_sitelib}/rdflib-%{version}.dist-info %files -n %{name}-doc %doc docs/_build/html diff --git a/rdflib-6.1.1.tar.gz b/rdflib-6.1.1.tar.gz deleted file mode 100644 index 3a6d5bc..0000000 --- a/rdflib-6.1.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8dbfa0af2990b98471dacbc936d6494c997ede92fd8ed693fb84ee700ef6f754 -size 1587670 diff --git a/rdflib-7.0.0.tar.gz b/rdflib-7.0.0.tar.gz new file mode 100644 index 0000000..574f34e --- /dev/null +++ b/rdflib-7.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9995eb8569428059b8c1affd26b25eac510d64f5043d9ce8c84e0d0036e995ae +size 4765796 diff --git a/reproducible.patch b/reproducible.patch deleted file mode 100644 index 58b7e65..0000000 --- a/reproducible.patch +++ /dev/null @@ -1,35 +0,0 @@ -Author: Bernhard M. Wiedemann -Date: Wed Dec 13 09:28:20 2023 +0100 - - Mark Restriction and Individual as private - - Fixes https://github.com/RDFLib/rdflib/issues/2645 - - Without this patch, the graph's random identifier leaked into - html/apidocs/rdflib.extras.html - - See https://reproducible-builds.org/ for why this matters. - - This patch was done while working on reproducible builds for openSUSE. - -Index: rdflib-6.1.1/rdflib/extras/infixowl.py -=================================================================== ---- rdflib-6.1.1.orig/rdflib/extras/infixowl.py -+++ rdflib-6.1.1/rdflib/extras/infixowl.py -@@ -365,6 +365,8 @@ class TermDeletionHelper: - class Individual(object): - """ - A typed individual -+ -+ :meta private: - """ - - factoryGraph = Graph() -@@ -1606,6 +1608,7 @@ class Restriction(Class): - individualRestrictionComponent - { individualRestrictionComponent } ')' - -+ :meta private: - """ - - restrictionKinds = [ From 55a5f4eb652912ed4b39fa3e09da334bc934f4b932511c58468e3fefa423ad94 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 3 Jul 2024 11:45:53 +0000 Subject: [PATCH 2/5] - Create doc subpackage with _multibuild to move python3-sphnix-autodoc-typehints build requirement out of ring1 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=64 --- _multibuild | 3 +++ python-rdflib.changes | 6 ++++++ python-rdflib.spec | 40 +++++++++++++++++++++++++++++++--------- 3 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..58ef5ee --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + doc + diff --git a/python-rdflib.changes b/python-rdflib.changes index 77366ea..7cff12a 100644 --- a/python-rdflib.changes +++ b/python-rdflib.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 3 11:44:54 UTC 2024 - Daniel Garcia + +- Create doc subpackage with _multibuild to move + python3-sphnix-autodoc-typehints build requirement out of ring1 + ------------------------------------------------------------------- Tue Feb 27 06:23:55 UTC 2024 - Steve Kowalik diff --git a/python-rdflib.spec b/python-rdflib.spec index e3709bb..28e0812 100644 --- a/python-rdflib.spec +++ b/python-rdflib.spec @@ -16,8 +16,17 @@ # -# Tests don't work and cause a dependency loop with python-SPARQLWrapper %bcond_with tests + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "doc" +%bcond_without doc +%bcond_with tests +%else +%bcond_with doc +%bcond_with tests +%endif + Name: python-rdflib Version: 7.0.0 Release: 0 @@ -29,7 +38,7 @@ BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module html5lib} BuildRequires: %{python_module isodate} BuildRequires: %{python_module pip} -BuildRequires: %{python_module poetry} +BuildRequires: %{python_module poetry-core} BuildRequires: %{python_module pyparsing} BuildRequires: %{python_module wheel} BuildRequires: %{python_module xml} @@ -37,7 +46,6 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx BuildRequires: python3-myst-parser -BuildRequires: python3-sphinx-autodoc-typehints BuildRequires: python3-sphinxcontrib-apidoc Requires: python-html5lib Requires: python-isodate @@ -50,6 +58,9 @@ BuildRequires: %{python_module SPARQLWrapper} BuildRequires: %{python_module flake8} BuildRequires: %{python_module pytest} %endif +%if %{with doc} +BuildRequires: python3-sphinx-autodoc-typehints +%endif %python_subpackages %description @@ -61,6 +72,7 @@ The library also contains both in-memory and persistent Graph backends. %package -n %{name}-doc Summary: A Python library for working with RDF Provides: %{python_module rdflib-doc = %{version}} +BuildRequires: %{python_module rdflib = %{version}} %description -n %{name}-doc RDFLib is a Python library for working with RDF, a simple yet powerful @@ -73,27 +85,33 @@ The library also contains both in-memory and persistent Graph backends. # remove unwanted shebang find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }' +%if %{without doc} %build %pyproject_wheel +%endif %install -%pyproject_install +%if %{with doc} # Build the docs, we need the module queryable pushd docs PYTHONPATH=%{buildroot}%{python3_sitelib} %make_build html + # Remove hidden file rm -r _build/html/.buildinfo popd +%fdupes docs/_build/html +exit 1 +%else +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/rdfs2dot %python_clone -a %{buildroot}%{_bindir}/rdfpipe %python_clone -a %{buildroot}%{_bindir}/rdfgraphisomorphism %python_clone -a %{buildroot}%{_bindir}/rdf2dot %python_clone -a %{buildroot}%{_bindir}/csv2rdf %python_expand %fdupes %{buildroot}%{$python_sitelib} - -%fdupes docs/_build/html +%endif %if %{with tests} %check @@ -114,6 +132,12 @@ popd %python_uninstall_alternative rdf2dot %python_uninstall_alternative csv2rdf +%if %{with doc} +%files -n %{name}-doc +%doc docs/_build/html + +%else + %files %{python_files} %license LICENSE %doc README.md @@ -124,8 +148,6 @@ popd %python_alternative %{_bindir}/rdfs2dot %{python_sitelib}/rdflib %{python_sitelib}/rdflib-%{version}.dist-info - -%files -n %{name}-doc -%doc docs/_build/html +%endif %changelog From fdab94da16c5b34c7af10e1e3b3e3b7c1deab596f9e2273f239103bc96c60969 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 3 Jul 2024 12:02:51 +0000 Subject: [PATCH 3/5] - remove debug line OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=65 --- python-rdflib.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-rdflib.spec b/python-rdflib.spec index 28e0812..d79335d 100644 --- a/python-rdflib.spec +++ b/python-rdflib.spec @@ -101,7 +101,6 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %make_build html rm -r _build/html/.buildinfo popd %fdupes docs/_build/html -exit 1 %else %pyproject_install From 8681d552cc8687de4f31627890f19e7a1761852645f14a52299b6073d8c35088 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 3 Jul 2024 15:18:27 +0000 Subject: [PATCH 4/5] - Place bcond_with tests above the name tag OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=66 --- python-rdflib.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python-rdflib.spec b/python-rdflib.spec index d79335d..2e5fdca 100644 --- a/python-rdflib.spec +++ b/python-rdflib.spec @@ -16,17 +16,15 @@ # -%bcond_with tests - %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "doc" %bcond_without doc -%bcond_with tests %else %bcond_with doc -%bcond_with tests %endif +# Tests don't work and cause a dependency loop with python-SPARQLWrapper +%bcond_with tests Name: python-rdflib Version: 7.0.0 Release: 0 From 1b6bb810d36cc4b824051776679f395ee816f7a6b454a0839159831f1684d6ac Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 3 Jul 2024 16:23:17 +0000 Subject: [PATCH 5/5] Use same package decl for doc multibuild OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=67 --- python-rdflib.spec | 66 ++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/python-rdflib.spec b/python-rdflib.spec index 2e5fdca..8bfc801 100644 --- a/python-rdflib.spec +++ b/python-rdflib.spec @@ -19,19 +19,41 @@ %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "doc" %bcond_without doc +%define psuffix -doc %else %bcond_with doc +%define psuffix %{nil} %endif # Tests don't work and cause a dependency loop with python-SPARQLWrapper %bcond_with tests -Name: python-rdflib +Name: python-rdflib%{psuffix} Version: 7.0.0 Release: 0 Summary: A Python library for working with RDF License: BSD-3-Clause URL: http://rdflib.net/ Source: https://files.pythonhosted.org/packages/source/r/rdflib/rdflib-%{version}.tar.gz +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch + +%if %{with tests} +BuildRequires: %{python_module SPARQLWrapper} +BuildRequires: %{python_module flake8} +BuildRequires: %{python_module pytest} +%endif + +%if %{with doc} +BuildRequires: %{python_module rdflib = %{version}} +BuildRequires: python3-Sphinx +BuildRequires: python3-myst-parser +BuildRequires: python3-sphinx-autodoc-typehints +BuildRequires: python3-sphinxcontrib-apidoc +Provides: %{python_module rdflib-doc = %{version}} +%else BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module html5lib} BuildRequires: %{python_module isodate} @@ -40,26 +62,11 @@ BuildRequires: %{python_module poetry-core} BuildRequires: %{python_module pyparsing} BuildRequires: %{python_module wheel} BuildRequires: %{python_module xml} -BuildRequires: fdupes -BuildRequires: python-rpm-macros -BuildRequires: python3-Sphinx -BuildRequires: python3-myst-parser -BuildRequires: python3-sphinxcontrib-apidoc Requires: python-html5lib Requires: python-isodate Requires: python-pyparsing -Requires(post): update-alternatives -Requires(postun): update-alternatives -BuildArch: noarch -%if %{with tests} -BuildRequires: %{python_module SPARQLWrapper} -BuildRequires: %{python_module flake8} -BuildRequires: %{python_module pytest} -%endif -%if %{with doc} -BuildRequires: python3-sphinx-autodoc-typehints -%endif %python_subpackages +%endif %description RDFLib is a Python library for working with RDF, a simple yet powerful @@ -67,21 +74,11 @@ language for representing information. The library contains an RDF/XML parser/serializer that conforms to the RDF/XML Syntax Specification (Revised). The library also contains both in-memory and persistent Graph backends. -%package -n %{name}-doc -Summary: A Python library for working with RDF -Provides: %{python_module rdflib-doc = %{version}} -BuildRequires: %{python_module rdflib = %{version}} - -%description -n %{name}-doc -RDFLib is a Python library for working with RDF, a simple yet powerful -language for representing information. The library contains an RDF/XML -parser/serializer that conforms to the RDF/XML Syntax Specification (Revised). -The library also contains both in-memory and persistent Graph backends. - %prep %autosetup -p1 -n rdflib-%{version} # remove unwanted shebang find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }' +chmod -x rdflib/plugins/parsers/notation3.py %if %{without doc} %build @@ -89,7 +86,6 @@ find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }' %endif %install - %if %{with doc} # Build the docs, we need the module queryable pushd docs @@ -115,6 +111,12 @@ popd %pytest %endif +%if %{with doc} +%files -n %{name} +%doc docs/_build/html + +%else + %post %python_install_alternative rdfs2dot %python_install_alternative rdfpipe @@ -129,12 +131,6 @@ popd %python_uninstall_alternative rdf2dot %python_uninstall_alternative csv2rdf -%if %{with doc} -%files -n %{name}-doc -%doc docs/_build/html - -%else - %files %{python_files} %license LICENSE %doc README.md