setup.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. """adodbapi -- a pure Python PEP 249 DB-API package using Microsoft ADO
  2. Adodbapi can be run on CPython version 2.7,
  3. or IronPython version 2.6 and later,
  4. or Python 3.5 and later (after filtering through 2to3.py)
  5. """
  6. CLASSIFIERS = """\
  7. Development Status :: 5 - Production/Stable
  8. Intended Audience :: Developers
  9. License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
  10. Operating System :: Microsoft :: Windows
  11. Operating System :: POSIX :: Linux
  12. Programming Language :: Python
  13. Programming Language :: Python :: 3
  14. Programming Language :: SQL
  15. Topic :: Software Development
  16. Topic :: Software Development :: Libraries :: Python Modules
  17. Topic :: Database
  18. """
  19. NAME = 'adodbapi'
  20. MAINTAINER = "Vernon Cole"
  21. MAINTAINER_EMAIL = "vernondcole@gmail.com"
  22. DESCRIPTION = """A pure Python package implementing PEP 249 DB-API using Microsoft ADO."""
  23. URL = "http://sourceforge.net/projects/adodbapi"
  24. LICENSE = 'LGPL'
  25. CLASSIFIERS = filter(None, CLASSIFIERS.split('\n'))
  26. AUTHOR = "Henrik Ekelund, Vernon Cole, et.al."
  27. AUTHOR_EMAIL = "vernondcole@gmail.com"
  28. PLATFORMS = ["Windows","Linux"]
  29. VERSION = None # in case searching for version fails
  30. a = open('adodbapi.py') # find the version string in the source code
  31. for line in a:
  32. if '__version__' in line:
  33. VERSION = line.split("'")[1]
  34. print('adodbapi version="%s"' % VERSION)
  35. break
  36. a.close()
  37. ##DOWNLOAD_URL = "http://sourceforge.net/projects/adodbapi/files/adodbapi/" + VERSION.rsplit('.', 1)[0] + '/adodbapi-' + VERSION + '.zip'
  38. import sys
  39. def setup_package():
  40. from distutils.core import setup
  41. if sys.version_info >= (3, 0):
  42. try:
  43. from distutils.command.build_py import build_py_2to3 as build_py
  44. ## # exclude fixers that break already compatible code
  45. ## from lib2to3.refactor import get_fixers_from_package
  46. ## fixers = get_fixers_from_package('lib2to3.fixes')
  47. ## for skip_fixer in ['import']:
  48. ## fixers.remove('lib2to3.fixes.fix_' + skip_fixer)
  49. ## build_py.fixer_names = fixers
  50. except ImportError:
  51. raise ImportError("build_py_2to3 not found in distutils - it is required for Python 3.x")
  52. else:
  53. from distutils.command.build_py import build_py
  54. setup(
  55. cmdclass = {'build_py': build_py},
  56. name=NAME,
  57. maintainer=MAINTAINER,
  58. maintainer_email=MAINTAINER_EMAIL,
  59. description=DESCRIPTION,
  60. url=URL,
  61. keywords='database ado odbc dbapi db-api Microsoft SQL',
  62. ## download_url=DOWNLOAD_URL,
  63. long_description=open('README.txt').read(),
  64. license=LICENSE,
  65. classifiers=CLASSIFIERS,
  66. author=AUTHOR,
  67. author_email=AUTHOR_EMAIL,
  68. platforms=PLATFORMS,
  69. version=VERSION,
  70. package_dir = {'adodbapi':''},
  71. packages=['adodbapi'] )
  72. return
  73. if __name__ == '__main__':
  74. setup_package()