Accepting request 317569 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/317569
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pbr?expand=0&rev=18
This commit is contained in:
Stephan Kulow 2015-07-21 11:25:40 +00:00 committed by Git OBS Bridge
commit f827e0f0f2
5 changed files with 96 additions and 4 deletions

View File

@ -0,0 +1,67 @@
From 12e36886fe343f8103a21c60d6925115ad8dbc26 Mon Sep 17 00:00:00 2001
From: Thomas Bechtold <tbechtold@suse.com>
Date: Tue, 2 Jun 2015 18:40:38 +0200
Subject: [PATCH] Remove sphinx_config.init_values() manual call
The function signature for Sphinx's config.init_values() changed since
version 1.3. That leads to:
TypeError: init_values() takes exactly 2 arguments (1 given)
But the function is already correctly called from
application.Sphinx()'s constructor. So use the configuration object
from the application instead of creating an own config object.
Commit 1dfe9ef348c777bef67b2c2b1d35e50ebc720333 already introduced this
change and commit e41a9180ed3103bb45fa1d1be93ba951016b029c reverted it
due to build failures with Sphinx 1.1.3 . The failure occurred because
using the application class to detect if man pages can build raised a
warning which was treated as error. This case is now handled and tested
with Sphinx 1.1.3 and 1.3.1.
Change-Id: Idf6c7b329880c6698b61ee9e88f29c0f6e0956bf
Closes-Bug: #1379998
---
pbr/builddoc.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/pbr/builddoc.py b/pbr/builddoc.py
index 3c9a9a1..f7d7697 100644
--- a/pbr/builddoc.py
+++ b/pbr/builddoc.py
@@ -27,7 +27,6 @@ except ImportError:
try:
from sphinx import apidoc
from sphinx import application
- from sphinx import config
from sphinx import setup_command
except Exception as e:
# NOTE(dhellmann): During the installation of docutils, setuptools
@@ -129,10 +128,21 @@ class LocalBuildDoc(setup_command.BuildDoc):
confoverrides['release'] = self.release
if self.today:
confoverrides['today'] = self.today
- sphinx_config = config.Config(self.config_dir, 'conf.py', {}, [])
- sphinx_config.init_values()
- if self.builder == 'man' and len(sphinx_config.man_pages) == 0:
+
+ # NOTE(toabctl): creating the app with "warningiserror=False" is
+ # used to detect if man_pages are available.Only needed for sphinx<1.3
+ # See also https://github.com/sphinx-doc/sphinx/issues/1933
+ app = application.Sphinx(
+ self.source_dir, self.config_dir,
+ self.builder_target_dir, self.doctree_dir,
+ self.builder, confoverrides, status_stream,
+ freshenv=self.fresh_env, warningiserror=False)
+
+ if self.builder == 'man' and len(app.config.man_pages) == 0:
return
+
+ # NOTE(toabctl): Now create the app with "warningiserror=True for real
+ # usage
app = application.Sphinx(
self.source_dir, self.config_dir,
self.builder_target_dir, self.doctree_dir,
--
2.4.5

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d53899758799094f4de673b58abe310fe96e1f5d0ed02feec11e7aba197aabd3
size 97535

3
pbr-1.3.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1a6f8d514fc11d2571c75c207d932c106f024f199b5f12d25f8ca022b026c59d
size 99701

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Fri Jul 17 11:54:48 UTC 2015 - tbechtold@suse.com
- update to 1.3.0:
* Wrap env markers in parens
* Updated from global requirements
* Add more documentation around building docs
* Updated from global requirements
* Use string for 'OS_TEST_TIMEOUT' default
* Updated from global requirements
* This documents the use of comments that work between 2.6, 2.7 and 3.4
- Add 0001-Remove-sphinx_config.init_values-manual-call.patch . Needed
for newer Sphinx versions.
-------------------------------------------------------------------
Wed Jun 24 08:24:05 UTC 2015 - dmueller@suse.com
- update to 1.2.0:
* Strip markers from test requirements
* Revert "Remove sphinx_config.init_values(
-------------------------------------------------------------------
Tue Jun 9 07:17:47 UTC 2015 - tbechtold@suse.com

View File

@ -21,7 +21,7 @@
%bcond_with test
Name: python-pbr
Version: 1.1.0
Version: 1.3.0
Release: 0
Summary: Python Build Reasonableness
License: Apache-2.0
@ -29,6 +29,9 @@ Group: Development/Languages/Python
Url: http://pypi.python.org/pypi/pbr
Source: https://pypi.python.org/packages/source/p/pbr/pbr-%{version}.tar.gz
Source1: python-pbr-rpmlintrc
# NOTE(toabctl): this is currently in review: https://review.openstack.org/#/c/193462/
# needed to be abe to use pbr with newer Sphinx versions
Patch0: 0001-Remove-sphinx_config.init_values-manual-call.patch
BuildRequires: fdupes
BuildRequires: python-devel
BuildRequires: python-pip >= 1.4
@ -76,6 +79,7 @@ This package contains documentation files for %{name}.
%prep
%setup -q -n pbr-%{version}
%patch0 -p1
# Get rid of ugly build-time deps that require network:
sed -i "s/, 'sphinx\.ext\.intersphinx'//" doc/source/conf.py