From f94619f75856bc8b6a1cf7f48adee47ec82246a9 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 13 Dec 2017 02:50:19 -0800 Subject: [PATCH] Drop distutils workaround and simplify setup.py Modern Python installations contain setuptools. It is reasonable to expect it to exist. Simplifies setup.py and removes the large comment explaining the workaround. https://github.com/python-ldap/python-ldap/pull/123 --- setup.py | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/setup.py b/setup.py index 0afa555..2f6bd89 100644 --- a/setup.py +++ b/setup.py @@ -5,13 +5,7 @@ """ import sys,os - -has_setuptools = False -try: - from setuptools import setup, Extension - has_setuptools = True -except ImportError: - from distutils.core import setup, Extension +from setuptools import setup, Extension if sys.version_info[0] == 2 and sys.version_info[1] < 7: raise RuntimeError('This software requires Python 2.7 or 3.x.') @@ -66,24 +60,6 @@ class OpenLDAP2: #-- Let distutils/setuptools do the rest name = 'python-ldap' -# Python 2.3.6+ and setuptools are needed to build eggs, so -# let's handle setuptools' additional keyword arguments to -# setup() in a fashion that doesn't break compatibility to -# distutils. This still allows 'normal' builds where either -# Python > 2.3.5 or setuptools (or both ;o) are not available. -kwargs = {} -if has_setuptools: - kwargs = { - 'include_package_data': True, - 'install_requires': [ - 'setuptools', - 'pyasn1 >= 0.3.7', - 'pyasn1_modules >= 0.1.5', - ], - 'zip_safe': False, - 'python_requires': '>=2.7,!=3.0.*,!=3.1.*,!=3.2.*', - } - setup( #-- Package description name = name, @@ -186,6 +162,12 @@ class OpenLDAP2: ], package_dir = {'': 'Lib',}, data_files = LDAP_CLASS.extra_files, + include_package_data=True, + install_requires=[ + 'pyasn1 >= 0.3.7', + 'pyasn1_modules >= 0.1.5', + ], + zip_safe=False, + python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*', test_suite = 'Tests', - **kwargs )