I noticed we build manpages on source distributions,
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)
return
finally:
os.chdir(curdir)
# Copy resulting manpages.
mandir = os.path.join(os.path.dirname(__file__), 'man')
if os.path.exists(mandir):
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()
and I thought it seemed odd, so I googled around to see if this was the norm, and I found some arguments against it.
Also, I believe this is the reason sphinx needs to be installed prior to building with tox. Which makes sphinx a build-time dependency, which is not really what we want.
$ tox -e docs
GLOB sdist-make: /home/jacob/src/beets/setup.py
ERROR: invocation failed (exit code 1), logfile: /home/jacob/src/beets/.tox/log/GLOB-0.log
===================================================================================================================================== log start ======================================================================================================================================
sphinx-build -b man -d _build/doctrees . _build/man
make: sphinx-build: Command not found
make: *** [Makefile:117: man] Error 127
Traceback (most recent call last):
File "setup.py", line 54, in <module>
build_manpages()
File "setup.py", line 38, in build_manpages
subprocess.check_call(['make', 'man'])
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', 'man']' returned non-zero exit status 2.
====================================================================================================================================== log end =======================================================================================================================================
ERROR: FAIL could not package project - v = InvocationError('/usr/bin/python setup.py sdist --formats=zip --dist-dir .tox/dist', 1)
Basically, my question is, what is the reason that we do this, and should we continue to do it/are there better options?
Pinging @jackwilsdon and @adrian since I know they’ve both worked on this before.