1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 08:56:17 +00:00
supysonic/setup.py
Alban Féron ec92dec9ab
Build and include man pages in distributions
I do not fully understand how the building process works, and have some doubts
on what a "source distribution" should be.
The sdist might be polluted if a "man" directory exists at the project root
when building the distribution.
The inclusion of man pages in the wheel requires it to be built from the sdist,
so it's best to build both at the same time using "python -m build".

Closes #215
2021-12-31 18:05:43 +01:00

29 lines
763 B
Python

# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2021 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
import os.path
from distutils import dir_util
from setuptools import setup
from setuptools.command.sdist import sdist as _sdist
class sdist(_sdist):
def make_release_tree(self, base_dir, files):
super().make_release_tree(base_dir, files)
man_dir = os.path.join(base_dir, "man")
doctrees_dir = os.path.join(man_dir, ".doctrees")
self.spawn(["sphinx-build", "-q", "-b", "man", "docs", man_dir])
dir_util.remove_tree(doctrees_dir)
if __name__ == "__main__":
setup(
cmdclass={"sdist": sdist},
)