Skip to content

Commit f94619f

Browse files
jdufresneencukou
authored andcommitted
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. #123
1 parent e80cc61 commit f94619f

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

setup.py

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
"""
66

77
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
159

1610
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
1711
raise RuntimeError('This software requires Python 2.7 or 3.x.')
@@ -66,24 +60,6 @@ class OpenLDAP2:
6660
#-- Let distutils/setuptools do the rest
6761
name = 'python-ldap'
6862

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-
8763
setup(
8864
#-- Package description
8965
name = name,
@@ -186,6 +162,12 @@ class OpenLDAP2:
186162
],
187163
package_dir = {'': 'Lib',},
188164
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.*',
189172
test_suite = 'Tests',
190-
**kwargs
191173
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy