| 1 |
#!/usr/bin/env python3 |
| 2 |
|
| 3 |
# Libervia templates: collection of templates |
| 4 |
# Copyright (C) 2017-2021 Jérôme Poisson ([email protected]) |
| 5 |
# Copyright (C) 2017 Xavier Maillard ([email protected]) |
| 6 |
|
| 7 |
# This program is free software: you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU Affero General Public License as published by |
| 9 |
# the Free Software Foundation, either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
|
| 12 |
# This program is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU Affero General Public License for more details. |
| 16 |
|
| 17 |
# You should have received a copy of the GNU Affero General Public License |
| 18 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
import os |
| 21 |
from setuptools import setup, find_packages |
| 22 |
|
| 23 |
NAME = "libervia-templates" |
| 24 |
# NOTE: directory is still "sat_templates" for compatibility reason, |
| 25 |
# should be changed for 0.9 |
| 26 |
DIR_NAME = "sat_templates" |
| 27 |
|
| 28 |
|
| 29 |
with open(os.path.join(DIR_NAME, "VERSION")) as f: |
| 30 |
VERSION = f.read().strip() |
| 31 |
is_dev_version = VERSION.endswith("D") |
| 32 |
|
| 33 |
|
| 34 |
def sat_templates_dev_version(): |
| 35 |
"""Use mercurial data to compute version""" |
| 36 |
def version_scheme(version): |
| 37 |
return VERSION.replace("D", ".dev0") |
| 38 |
|
| 39 |
def local_scheme(version): |
| 40 |
return "+{rev}.{distance}".format( |
| 41 |
rev=version.node[1:], |
| 42 |
distance=version.distance) |
| 43 |
|
| 44 |
return {"version_scheme": version_scheme, |
| 45 |
"local_scheme": local_scheme} |
| 46 |
|
| 47 |
|
| 48 |
setup_info = dict( |
| 49 |
name=NAME, |
| 50 |
version=VERSION, |
| 51 |
description="Templates for Libervia XMPP client", |
| 52 |
long_description="Libervia Template is a common module which can be used by any SàT " |
| 53 |
"frontend to generate documents (mostly HTML but not only).", |
| 54 |
author="Association « Salut à Toi »", |
| 55 |
author_email="[email protected]", |
| 56 |
url="https://salut-a-toi.org", |
| 57 |
classifiers=[ |
| 58 |
"Programming Language :: Python :: 3 :: Only", |
| 59 |
"Programming Language :: Python :: 3.7", |
| 60 |
"Programming Language :: Python :: 3.8", |
| 61 |
"Programming Language :: Python :: 3.9", |
| 62 |
"Development Status :: 5 - Production/Stable", |
| 63 |
"License :: OSI Approved :: GNU Affero General Public License v3 or later " |
| 64 |
"(AGPLv3+)", |
| 65 |
], |
| 66 |
install_requires=[], |
| 67 |
setup_requires=["setuptools_scm"] if is_dev_version else [], |
| 68 |
use_scm_version=sat_templates_dev_version if is_dev_version else False, |
| 69 |
packages=find_packages(), |
| 70 |
include_package_data=True, |
| 71 |
zip_safe=False, |
| 72 |
python_requires=">=3.7", |
| 73 |
) |
| 74 |
|
| 75 |
setup(**setup_info) |