Skip to content

Commit e01cd16

Browse files
author
stroeder
committed
ldap.__version__, ldap.__author__ and ldap.__license__ now imported from new sub-module ldap.pkginfo also to setup.py
1 parent c0a269f commit e01cd16

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Modules/
1111
* removed unused code schema.c
1212

1313
Lib/
14+
* ldap.__version__, ldap.__author__ and ldap.__license__ now
15+
imported from new sub-module ldap.pkginfo also to setup.py
1416
* removed stand-alone module dsml
1517
* slapdtest.SlapdObject.restart() just restarts slapd
1618
without cleaning any data

Lib/ldap/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# This is also the overall release version number
88

9-
__version__ = '2.5.0'
9+
from pkginfo import __version__, __author__, __license__
1010

1111
import sys
1212

Lib/ldap/pkginfo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
meta attributes for packaging which does not import any dependencies
4+
"""
5+
__version__ = '2.5.0'
6+
__author__ = u'python-ldap project'
7+
__license__ = 'Python style'

setup.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,8 @@
1414
from ConfigParser import ConfigParser
1515
import sys,os,string,time
1616

17-
##################################################################
18-
# Weird Hack to grab release version of python-ldap from local dir
19-
##################################################################
20-
exec_startdir = os.path.dirname(os.path.abspath(sys.argv[0]))
21-
package_init_file_name = reduce(os.path.join,[exec_startdir,'Lib','ldap','__init__.py'])
22-
f = open(package_init_file_name,'r')
23-
s = f.readline()
24-
while s:
25-
s = string.strip(s)
26-
if s[0:11]=='__version__':
27-
version = eval(string.split(s,'=')[1])
28-
break
29-
s = f.readline()
30-
f.close()
17+
sys.path.insert(0, os.path.join(os.getcwd(), 'Lib/ldap'))
18+
import pkginfo
3119

3220
#-- A class describing the features and requirements of OpenLDAP 2.0
3321
class OpenLDAP2:
@@ -78,7 +66,8 @@ class OpenLDAP2:
7866
setup(
7967
#-- Package description
8068
name = name,
81-
version = version,
69+
license=pkginfo.__license__,
70+
version=pkginfo.__version__,
8271
description = 'Python modules for implementing LDAP clients',
8372
long_description = """python-ldap:
8473
python-ldap provides an object-oriented API to access LDAP directory servers
@@ -87,7 +76,7 @@ class OpenLDAP2:
8776
(e.g. processing LDIF, LDAPURLs, LDAPv3 schema, LDAPv3 extended operations
8877
and controls, etc.).
8978
""",
90-
author = 'python-ldap project',
79+
author = pkginfo.__author__,
9180
author_email = 'python-ldap@python.org',
9281
url = 'https://www.python-ldap.org/',
9382
download_url = 'https://pypi.python.org/pypi/python-ldap/',
@@ -108,7 +97,6 @@ class OpenLDAP2:
10897
'Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP',
10998
'License :: OSI Approved :: Python Software Foundation License',
11099
],
111-
license = 'Python style',
112100
#-- C extension modules
113101
ext_modules = [
114102
Extension(
@@ -137,7 +125,7 @@ class OpenLDAP2:
137125
('ldap_r' in LDAP_CLASS.libs or 'oldap_r' in LDAP_CLASS.libs)*[('HAVE_LIBLDAP_R',None)] + \
138126
('sasl' in LDAP_CLASS.libs or 'sasl2' in LDAP_CLASS.libs or 'libsasl' in LDAP_CLASS.libs)*[('HAVE_SASL',None)] + \
139127
('ssl' in LDAP_CLASS.libs and 'crypto' in LDAP_CLASS.libs)*[('HAVE_TLS',None)] + \
140-
[('LDAPMODULE_VERSION', version)]
128+
[('LDAPMODULE_VERSION', pkginfo.__version__)]
141129
),
142130
],
143131
#-- Python "stand alone" modules

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