Updated build mechanism

This commit is contained in:
Spitfireap
2024-06-22 19:45:57 +02:00
parent 883dad9b15
commit 26c18af0e8
4 changed files with 10 additions and 59 deletions
+2 -2
View File
@@ -42,10 +42,10 @@ To do so, run the following commands::
$ source <path>/bin/activate
$ git clone https://github.com/modoboa/modoboa.git
$ cd modoboa
$ python setup.py develop
$ pip install -e .
$ pip install -r dev-requirements.txt
The ``develop`` command creates a symbolic link to your local copy so
This will create a symbolic link to your local copy so
any modification you make will be automatically available in your
environment, no need to copy them.
+1 -1
View File
@@ -36,7 +36,7 @@ services:
command: >
sh -c "cd test_project
python3 manage.py migrate
python3 manage.py load_initial_data
python3 manage.py load_initial_data --dev
django-admin compilemessages
python3 manage.py runserver_plus 0.0.0.0:8000 --cert-file cert.crt"
volumes:
+7 -1
View File
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.4"]
build-backend = "setuptools.build_meta"
[project]
@@ -43,3 +43,9 @@ repository = "https://github.com/modoboa/modoboa"
[tool.setuptools.dynamic]
version = {attr = "modoboa.version.get_version"}
dependencies = {file = ["requirements.txt"]}
optional-dependencies.dev = { file = ["dev-requirements.txt"] }
optional-dependencies.test = { file = ["test-requirements.txt"] }
optional-dependencies.ldap = { file = ["ldap-requirements.txt"] }
optional-dependencies.mysql = { file = ["mysql-requirements.txt"] }
optional-dependencies.postgresql = { file = ["postgresql-requirements.txt"] }
-55
View File
@@ -9,39 +9,11 @@ https://packaging.python.org/en/latest/distributing.html
from os import path
try:
from pip.req import parse_requirements
except ImportError:
# pip >= 10
from pip._internal.req import parse_requirements
from setuptools import find_packages, setup
def get_requirements(requirements_file):
"""Use pip to parse requirements file."""
requirements = []
if path.isfile(requirements_file):
for req in parse_requirements(requirements_file, session="hack"):
try:
if req.markers:
requirements.append("%s;%s" % (req.req, req.markers))
else:
requirements.append("%s" % req.req)
except AttributeError:
# pip >= 20.0.2
requirements.append(req.requirement)
return requirements
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 open(path.join(HERE, "README.rst")) as readme:
LONG_DESCRIPTION = readme.read()
@@ -52,42 +24,15 @@ if __name__ == "__main__":
return ""
setup(
name="modoboa",
description="Mail hosting made simple",
long_description=LONG_DESCRIPTION,
license="ISC",
url="http://modoboa.org/",
author="Antoine Nguyen",
author_email="tonio@ngyn.org",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django :: 2.2",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: ISC License (ISCL)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Communications :: Email",
"Topic :: Internet :: WWW/HTTP",
],
keywords="email",
packages=find_packages(
exclude=["doc", "test_data", "test_project", "frontend"]
),
include_package_data=True,
zip_safe=False,
scripts=["bin/modoboa-admin.py"],
install_requires=INSTALL_REQUIRES,
use_scm_version={"local_scheme": local_scheme},
python_requires=">=3.7",
setup_requires=["setuptools_scm>6.4"],
extras_require={
"ldap": LDAP_REQUIRES,
"mysql": MYSQL_REQUIRES,
"postgresql": POSTGRESQL_REQUIRES,
"argon2": ["argon2-cffi >= 16.1.0"],
},
)