Skip to content

Commit

Permalink
ldap.__version__, ldap.__author__ and ldap.__license__ now imported f…
Browse files Browse the repository at this point in the history
…rom new sub-module ldap.pkginfo also to setup.py
  • Loading branch information
stroeder committed Nov 12, 2017
1 parent c0a269f commit e01cd16
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Modules/
* removed unused code schema.c

Lib/
* ldap.__version__, ldap.__author__ and ldap.__license__ now
imported from new sub-module ldap.pkginfo also to setup.py
* removed stand-alone module dsml
* slapdtest.SlapdObject.restart() just restarts slapd
without cleaning any data
Expand Down
2 changes: 1 addition & 1 deletion Lib/ldap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# This is also the overall release version number

__version__ = '2.5.0'
from pkginfo import __version__, __author__, __license__

import sys

Expand Down
7 changes: 7 additions & 0 deletions Lib/ldap/pkginfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
"""
meta attributes for packaging which does not import any dependencies
"""
__version__ = '2.5.0'
__author__ = u'python-ldap project'
__license__ = 'Python style'
24 changes: 6 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,8 @@
from ConfigParser import ConfigParser
import sys,os,string,time

##################################################################
# Weird Hack to grab release version of python-ldap from local dir
##################################################################
exec_startdir = os.path.dirname(os.path.abspath(sys.argv[0]))
package_init_file_name = reduce(os.path.join,[exec_startdir,'Lib','ldap','__init__.py'])
f = open(package_init_file_name,'r')
s = f.readline()
while s:
s = string.strip(s)
if s[0:11]=='__version__':
version = eval(string.split(s,'=')[1])
break
s = f.readline()
f.close()
sys.path.insert(0, os.path.join(os.getcwd(), 'Lib/ldap'))
import pkginfo

#-- A class describing the features and requirements of OpenLDAP 2.0
class OpenLDAP2:
Expand Down Expand Up @@ -78,7 +66,8 @@ class OpenLDAP2:
setup(
#-- Package description
name = name,
version = version,
license=pkginfo.__license__,
version=pkginfo.__version__,
description = 'Python modules for implementing LDAP clients',
long_description = """python-ldap:
python-ldap provides an object-oriented API to access LDAP directory servers
Expand All @@ -87,7 +76,7 @@ class OpenLDAP2:
(e.g. processing LDIF, LDAPURLs, LDAPv3 schema, LDAPv3 extended operations
and controls, etc.).
""",
author = 'python-ldap project',
author = pkginfo.__author__,
author_email = 'python-ldap@python.org',
url = 'https://www.python-ldap.org/',
download_url = 'https://pypi.python.org/pypi/python-ldap/',
Expand All @@ -108,7 +97,6 @@ class OpenLDAP2:
'Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP',
'License :: OSI Approved :: Python Software Foundation License',
],
license = 'Python style',
#-- C extension modules
ext_modules = [
Extension(
Expand Down Expand Up @@ -137,7 +125,7 @@ class OpenLDAP2:
('ldap_r' in LDAP_CLASS.libs or 'oldap_r' in LDAP_CLASS.libs)*[('HAVE_LIBLDAP_R',None)] + \
('sasl' in LDAP_CLASS.libs or 'sasl2' in LDAP_CLASS.libs or 'libsasl' in LDAP_CLASS.libs)*[('HAVE_SASL',None)] + \
('ssl' in LDAP_CLASS.libs and 'crypto' in LDAP_CLASS.libs)*[('HAVE_TLS',None)] + \
[('LDAPMODULE_VERSION', version)]
[('LDAPMODULE_VERSION', pkginfo.__version__)]
),
],
#-- Python "stand alone" modules
Expand Down

0 comments on commit e01cd16

Please sign in to comment.