from setuptools import setup, find_packages, Command import subprocess import os mysql_driver = "PyMySQL" if os.name == "nt" else "mysqlclient" class DocsCommand(Command): description = "Generate and export API documentation using pdoc3" 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( packages=find_packages(), package_data={"": ["*.toml"]}, scripts=["run_flaschengeist"], python_requires=">=3.7", install_requires=[ "Flask >= 1.1", "toml", "sqlalchemy>=1.4", "flask_sqlalchemy>=2.5", "flask_cors", "werkzeug", mysql_driver, ], extras_require={"ldap": ["flask_ldapconn", "ldap3"], "pricelist": ["pillow"], "test": ["pytest", "coverage"]}, entry_points={ "flaschengeist.plugin": [ # Authentication providers "auth_plain = flaschengeist.plugins.auth_plain:AuthPlain", "auth_ldap = flaschengeist.plugins.auth_ldap:AuthLDAP [ldap]", # Route providers (and misc) "auth = flaschengeist.plugins.auth:AuthRoutePlugin", "users = flaschengeist.plugins.users:UsersPlugin", "roles = flaschengeist.plugins.roles:RolesPlugin", "balance = flaschengeist.plugins.balance:BalancePlugin", "events = flaschengeist.plugins.events:EventPlugin", "mail = flaschengeist.plugins.message_mail:MailMessagePlugin", "pricelist = flaschengeist.plugins.pricelist:PriceListPlugin [pricelist]", ], }, cmdclass={ "docs": DocsCommand, }, )