add extra optional packages

Add the ability to install optional packages when installing modoboa. For example if I wanted to use modoboa with PostgreSQL `pip install modoboa[postgresql]`, or if I wanted MySQL and LDAP support `pip install modoboa[mysql,ldap]`

mysqlclient minimum version has been pined to 1.3.11 due to an issue with MariaDB 10 (#1341)
This commit is contained in:
Andrew Fyfe
2018-01-12 22:45:09 +00:00
parent dfabe89899
commit b4c0be2c9b
3 changed files with 11 additions and 0 deletions
+9
View File
@@ -33,6 +33,10 @@ def get_requirements(requirements_file):
if __name__ == "__main__":
HERE = path.abspath(path.dirname(__file__))
INSTALL_REQUIRES = get_requirements(path.join(HERE, "requirements.txt"))
MYSQL_REQUIRES = get_requirements(path.join(HERE, "mysql-requirements.txt"))
POSTGRESQL_REQUIRES = get_requirements(
path.join(HERE, "postgresql-requirements.txt"))
LDAP_REQUIRES = get_requirements(path.join(HERE, "ldap-requirements.txt"))
with io.open(path.join(HERE, "README.rst"), encoding="utf-8") as readme:
LONG_DESCRIPTION = readme.read()
@@ -69,4 +73,9 @@ if __name__ == "__main__":
install_requires=INSTALL_REQUIRES,
use_scm_version=True,
setup_requires=["setuptools_scm"],
extras_require={
"ldap": LDAP_REQUIRES,
"mysql": MYSQL_REQUIRES,
"postgresql": POSTGRESQL_REQUIRES,
},
)