From: Oleg Broytman Date: Fri, 20 Dec 2013 17:27:20 +0000 (+0400) Subject: Use setuptools X-Git-Tag: 2.1.3~20 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=61071fd7a9a44a533020062305c72d6d9502cb5e;p=m_lib.git Use setuptools --- diff --git a/INSTALL.txt b/INSTALL.txt index 5d05b64..d04b87f 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,5 +1,8 @@ m_lib requires Python2; preferred versions are 2.6 or 2.7. +Installation script setup.py requires setuptools. If you don't have it +installed setup.py will try to download and install it. + To install the library from sources system-wide run run the following command: diff --git a/setup.py b/setup.py index 305bfce..ec46baa 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,21 @@ #! /usr/bin/env python -from distutils.core import setup +try: + from ez_setup import use_setuptools + use_setuptools() + from setuptools import setup + is_setuptools = True +except ImportError: + from distutils.core import setup + is_setuptools = False + +kw = {} +if is_setuptools: + kw['extras_require'] = { + 'Mk4py': ['Mk4py'], + 'ZODB': ['ZODB'], + 'mx': ['mx.DateTime', 'mx.Misc'], + } setup(name = "m_lib", version = "2.1.0", @@ -16,4 +31,5 @@ setup(name = "m_lib", "m_lib.net", "m_lib.net.ftp", "m_lib.net.www", "m_lib.pbar", "m_lib.rus", ], + **kw )