Merge lp:~manishsinha/microfiber/fix-hardcoded-sphinx-build-in-usrbin into lp:microfiber
Status: | Merged |
---|---|
Merged at revision: | 78 |
Proposed branch: | lp:~manishsinha/microfiber/fix-hardcoded-sphinx-build-in-usrbin |
Merge into: | lp:microfiber |
Diff against target: |
24 lines (+10/-2) 1 file modified
setup.py (+10/-2) |
To merge this branch: | bzr merge lp:~manishsinha/microfiber/fix-hardcoded-sphinx-build-in-usrbin |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Gerard DeRose | Approve | ||
Review via email:
|
Commit message
Fixed bugs #847044 where sphinx-build was hardcoded at /usr/bin/
Read the $PATH environment variable. Split it by : character. For every entry append
'sphinx-build' and check whether the file exists. If the file exists, check if it
is executable. If yes, then return the path. If none is found then return None.
The method calling this search method has to handle None return by showing a WARNING
Description of the change
Fixed bugs #847044 where sphinx-build was hardcoded at /usr/bin/
Read the $PATH environment variable. Split it by : character. For every entry append
'sphinx-build' and check whether the file exists. If the file exists, check if it
is executable. If yes, then return the path. If none is found then return None.
The method calling this search method has to handle None return by showing a WARNING
After thinking on this a bit, I feel something like this is a better solution:
class build_with_ docs(build) :
def run(self):
build. run(self) check_output( ['/bin/ which', 'sphinx-build']) CalledProcessEr ror:
print( "WARNING: Documentation not generated. python-sphinx missing") path.abspath( __file_ _))
subprocess. check_call( cmd)
try:
sphinx = subprocess.
except subprocess.
return
tree = path.dirname(
src = path.join(tree, 'doc')
dst = path.join(tree, 'doc', '_build', 'html')
cmd = [
sphinx,
'-b', 'html',
src,
dst
]
What do you think?