[setup] Added build documentation target
This commit is contained in:
parent
da94acf18c
commit
114e12f151
|
@ -67,6 +67,7 @@ instance/
|
||||||
|
|
||||||
# Sphinx documentation
|
# Sphinx documentation
|
||||||
docs/_build/
|
docs/_build/
|
||||||
|
docs/
|
||||||
|
|
||||||
# PyBuilder
|
# PyBuilder
|
||||||
target/
|
target/
|
||||||
|
|
31
setup.py
31
setup.py
|
@ -1,11 +1,35 @@
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages, Command
|
||||||
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
|
||||||
mysql_driver = "PyMySQL" if os.name == "nt" else "mysqlclient"
|
mysql_driver = "PyMySQL" if os.name == "nt" else "mysqlclient"
|
||||||
|
|
||||||
|
|
||||||
|
class DocsCommand(Command):
|
||||||
|
description = "Generate and export API documentation"
|
||||||
|
user_options = [
|
||||||
|
# The format is (long option, short option, description).
|
||||||
|
("output=", "o", "Documentation output path"),
|
||||||
|
]
|
||||||
|
|
||||||
|
def initialize_options(self):
|
||||||
|
self.output = "./docs"
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
"""Run command."""
|
||||||
|
command = ["python", "-m", "pdoc", "--skip-errors", "--html", "--output-dir", self.output, "flaschengeist"]
|
||||||
|
self.announce(
|
||||||
|
"Running command: %s" % str(command),
|
||||||
|
)
|
||||||
|
subprocess.check_call(command)
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="flaschengeist",
|
name="flaschengeist",
|
||||||
version="2.0.0-dev",
|
version="2.0.0.dev0",
|
||||||
url="https://wu5.de/redmine/projects/geruecht",
|
url="https://wu5.de/redmine/projects/geruecht",
|
||||||
author="WU5 + Friends",
|
author="WU5 + Friends",
|
||||||
author_email="tim@groeger-clan.de",
|
author_email="tim@groeger-clan.de",
|
||||||
|
@ -39,4 +63,7 @@ setup(
|
||||||
"pricelist = flaschengeist.plugins.pricelist:PriceListPlugin [pricelist]",
|
"pricelist = flaschengeist.plugins.pricelist:PriceListPlugin [pricelist]",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
cmdclass={
|
||||||
|
"docs": DocsCommand,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue