From 2437ef2417b74960f2d9d03670d23c2004303c179feaa6a551ca57eeffcb1c98 Mon Sep 17 00:00:00 2001 From: Todd R Date: Fri, 1 Sep 2017 15:30:04 +0000 Subject: [PATCH] Accepting request 520217 from home:TheBlackCat:branches:devel:languages:python - Create a base sphinxcontrib namespace package to guarantee all the "python(2|3)-sphinxcontrib-foo" packages can be imported correctly. OBS-URL: https://build.opensuse.org/request/show/520217 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Sphinx?expand=0&rev=89 --- __init__.py | 2 ++ python-Sphinx.changes | 7 +++++++ python-Sphinx.spec | 12 ++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..2f0b64f --- /dev/null +++ b/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +__import__('pkg_resources').declare_namespace(__name__) diff --git a/python-Sphinx.changes b/python-Sphinx.changes index 30f33a0..9b68eea 100644 --- a/python-Sphinx.changes +++ b/python-Sphinx.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Aug 31 22:47:36 UTC 2017 - toddrme2178@gmail.com + +- Create a base sphinxcontrib namespace package to guarantee all + the "python(2|3)-sphinxcontrib-foo" packages can be imported + correctly. + ------------------------------------------------------------------- Thu Aug 24 15:55:01 UTC 2017 - toddrme2178@gmail.com diff --git a/python-Sphinx.spec b/python-Sphinx.spec index f5e68e5..84dd458 100644 --- a/python-Sphinx.spec +++ b/python-Sphinx.spec @@ -32,6 +32,7 @@ Summary: Python documentation generator License: BSD-2-Clause Group: Development/Languages/Python Source: https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz +Source10: https://raw.githubusercontent.com/sphinx-doc/sphinxcontrib-websupport/1.0.1/sphinxcontrib/__init__.py Patch1: disable-test.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: %{python_module devel} @@ -186,6 +187,13 @@ sed -i 's/\r$//' sphinx/themes/basic/static/jquery.js # Fix wrong end-of-line en %install %python_install +# Set up the sphinxcontrib namespace package +%{python_expand mkdir -p %{buildroot}%{$python_sitelib}/sphinxcontrib/ +cp %{SOURCE10} %{buildroot}%{$python_sitelib}/sphinxcontrib/ +$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/sphinxcontrib/ +$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/sphinxcontrib/ +} + %python_clone -a %{buildroot}%{_bindir}/sphinx-apidoc %python_clone -a %{buildroot}%{_bindir}/sphinx-autogen %python_clone -a %{buildroot}%{_bindir}/sphinx-build @@ -211,6 +219,10 @@ sed -i 's/\r$//' sphinx/themes/basic/static/jquery.js # Fix wrong end-of-line en %exclude %{python_sitelib}/sphinx/texinputs/ %endif %{python_sitelib}/Sphinx-%{version}-py*.egg-info +%dir %{python_sitelib}/sphinxcontrib/ +%{python_sitelib}/sphinxcontrib/__init__.py* +%pycache_only %dir %{python_sitelib}/sphinxcontrib/__pycache__/ +%pycache_only %{python_sitelib}/sphinxcontrib/__pycache__/__init__*.py* # Requirements are not available on SLES %if %{with latex}