Don't import radicale in setup.py

This commit is contained in:
Guillaume Ayoub 2016-04-10 11:31:52 +02:00
parent 9f969cfaf5
commit 8102926148

View File

@ -35,22 +35,28 @@ For further information, please visit the `Radicale Website
"""
import re
from os import path
from setuptools import setup
import radicale
init_path = path.join(path.dirname(__file__), "radicale", "__init__.py")
with open(init_path, "r", encoding="utf-8") as fd:
version = re.search('VERSION = "([^"]+)"', fd.read().strip()).group(1)
# When the version is updated, ``radicale.VERSION`` must be modified.
# A new section in the ``NEWS`` file must be added too.
setup(
name="Radicale",
version=radicale.VERSION,
version=version,
description="CalDAV and CardDAV Server",
long_description=__doc__,
author="Guillaume Ayoub",
author_email="guillaume.ayoub@kozea.fr",
url="http://www.radicale.org/",
download_url=("http://pypi.python.org/packages/source/R/Radicale/"
"Radicale-%s.tar.gz" % radicale.VERSION),
"Radicale-%s.tar.gz" % version),
license="GNU GPL v3",
platforms="Any",
packages=["radicale"],