setup.py sdist: Allow make man failure

This should let us run Tox on Windows, where Make isn't available.
This commit is contained in:
Adrian Sampson 2015-04-14 10:02:09 -07:00
parent 168678cc3f
commit 2f7f037e8e

View file

@ -28,14 +28,15 @@ def _read(fn):
return open(path).read()
# Build manpages if we're making a source distribution tarball.
if 'sdist' in sys.argv:
def build_manpages():
# Go into the docs directory and build the manpage.
docdir = os.path.join(os.path.dirname(__file__), 'docs')
curdir = os.getcwd()
os.chdir(docdir)
try:
subprocess.check_call(['make', 'man'])
except OSError:
print("Could not build manpages (make man failed)!", file=sys.stderr)
finally:
os.chdir(curdir)
@ -45,6 +46,12 @@ if 'sdist' in sys.argv:
shutil.rmtree(mandir)
shutil.copytree(os.path.join(docdir, '_build', 'man'), mandir)
# Build manpages if we're making a source distribution tarball.
if 'sdist' in sys.argv:
build_manpages()
setup(
name='beets',
version='1.3.12',