|
5 | 5 | """
|
6 | 6 |
|
7 | 7 | import sys,os
|
8 |
| - |
9 |
| -has_setuptools = False |
10 |
| -try: |
11 |
| - from setuptools import setup, Extension |
12 |
| - has_setuptools = True |
13 |
| -except ImportError: |
14 |
| - from distutils.core import setup, Extension |
| 8 | +from setuptools import setup, Extension |
15 | 9 |
|
16 | 10 | if sys.version_info[0] == 2 and sys.version_info[1] < 7:
|
17 | 11 | raise RuntimeError('This software requires Python 2.7 or 3.x.')
|
@@ -66,24 +60,6 @@ class OpenLDAP2:
|
66 | 60 | #-- Let distutils/setuptools do the rest
|
67 | 61 | name = 'python-ldap'
|
68 | 62 |
|
69 |
| -# Python 2.3.6+ and setuptools are needed to build eggs, so |
70 |
| -# let's handle setuptools' additional keyword arguments to |
71 |
| -# setup() in a fashion that doesn't break compatibility to |
72 |
| -# distutils. This still allows 'normal' builds where either |
73 |
| -# Python > 2.3.5 or setuptools (or both ;o) are not available. |
74 |
| -kwargs = {} |
75 |
| -if has_setuptools: |
76 |
| - kwargs = { |
77 |
| - 'include_package_data': True, |
78 |
| - 'install_requires': [ |
79 |
| - 'setuptools', |
80 |
| - 'pyasn1 >= 0.3.7', |
81 |
| - 'pyasn1_modules >= 0.1.5', |
82 |
| - ], |
83 |
| - 'zip_safe': False, |
84 |
| - 'python_requires': '>=2.7,!=3.0.*,!=3.1.*,!=3.2.*', |
85 |
| - } |
86 |
| - |
87 | 63 | setup(
|
88 | 64 | #-- Package description
|
89 | 65 | name = name,
|
@@ -186,6 +162,12 @@ class OpenLDAP2:
|
186 | 162 | ],
|
187 | 163 | package_dir = {'': 'Lib',},
|
188 | 164 | data_files = LDAP_CLASS.extra_files,
|
| 165 | + include_package_data=True, |
| 166 | + install_requires=[ |
| 167 | + 'pyasn1 >= 0.3.7', |
| 168 | + 'pyasn1_modules >= 0.1.5', |
| 169 | + ], |
| 170 | + zip_safe=False, |
| 171 | + python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*', |
189 | 172 | test_suite = 'Tests',
|
190 |
| - **kwargs |
191 | 173 | )
|
0 commit comments