Merge lp:~mordred/glance/conditional-sphinx into lp:~hudson-openstack/glance/trunk

Proposed by Monty Taylor
Status: Merged
Approved by: Monty Taylor
Approved revision: 52
Merged at revision: 53
Proposed branch: lp:~mordred/glance/conditional-sphinx
Merge into: lp:~hudson-openstack/glance/trunk
Diff against target: 47 lines (+15/-11)
1 file modified
setup.py (+15/-11)
To merge this branch: bzr merge lp:~mordred/glance/conditional-sphinx
Reviewer Review Type Date Requested Status
Rick Harris (community) Needs Fixing
Devin Carlen (community) Approve
Jay Pipes (community) Approve
Review via email: mp+47452@code.launchpad.net

Description of the change

Should fix the sphinx issue.

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

cool.

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The person who submitted this branch (mordred) does not appear in http://wiki.openstack.org/Contributors?action=raw

Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Rick Harris (rconradharris) wrote :

Small-nit:

36 +except:

The unguarded `except` looks a little suspicious, should this be `except ImportError` or are there other exceptions here that would be considered 'normal'?

review: Needs Fixing
Revision history for this message
Monty Taylor (mordred) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/25/2011 01:41 PM, Rick Harris wrote:
> Review: Needs Fixing Small-nit:
>
> 36 +except:
>
> The unguarded `except` looks a little suspicious, should this be
> `except ImportError` or are there other exceptions here that would be
> considered 'normal'?

Well - normally I'd agree with you. In _this_ case, the idea is that we
want sphinx building to be optional - so if something goes wrong in
setting that up, we'd like to just move on.

I can put in an ImportError: trap though if you'd prefer.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0/WhwACgkQ2Jv7/VK1RgEzvACfZN9jwkvA7gv8R9rNvyopNZRt
40IAoOa7C6ZGIANSEkyqIpoopDnAOSjv
=Ewxf
-----END PGP SIGNATURE-----

Revision history for this message
Rick Harris (rconradharris) wrote :

I'm leaving it as `except`, though, it might be preferable to do something like

try:
  <stuff>
except ImportError:
  pass # if it's not there, don't worry about it
except:
  LOG.warn("Strange thing occured, perhaps look into this?")

Revision history for this message
Rick Harris (rconradharris) wrote :

s/I'm leaving it as/I'm fine leaving it as/

Revision history for this message
Jay Pipes (jaypipes) wrote :

I'll fix the except nit later. Gotta get this in to release a new tarball...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'setup.py'
2--- setup.py 2011-01-25 17:02:07 +0000
3+++ setup.py 2011-01-25 19:50:05 +0000
4@@ -19,15 +19,6 @@
5
6 from setuptools import setup, find_packages
7 from setuptools.command.sdist import sdist
8-from sphinx.setup_command import BuildDoc
9-
10-
11-class local_BuildDoc(BuildDoc):
12- def run(self):
13- for builder in ['html', 'man']:
14- self.builder = builder
15- self.finalize_options()
16- BuildDoc.run(self)
17
18
19 class local_sdist(sdist):
20@@ -44,12 +35,25 @@
21 changelog_file.write(changelog)
22 sdist.run(self)
23
24+cmdclass = {'sdist': local_sdist}
25+
26+try:
27+ from sphinx.setup_command import BuildDoc
28+ class local_BuildDoc(BuildDoc):
29+ def run(self):
30+ for builder in ['html', 'man']:
31+ self.builder = builder
32+ self.finalize_options()
33+ BuildDoc.run(self)
34+ cmdclass['build_sphinx'] = local_BuildDoc
35+
36+except:
37+ pass
38+
39
40 name = 'glance'
41 version = '0.1.5'
42
43-cmdclass = {'sdist': local_sdist,
44- 'build_sphinx': local_BuildDoc}
45
46 setup(
47 name=name,

Subscribers

People subscribed via source and target branches