setup.py 609 B

123456789101112131415161718192021
  1. #!/usr/bin/env python
  2. import os
  3. import sys
  4. import distutils.errors
  5. import setuptools
  6. if not hasattr(sys, "hexversion") or sys.hexversion < 0x02040000:
  7. raise distutils.errors.DistutilsError("Python 2.4 or newer is required")
  8. if os.name == "posix":
  9. from setup_posix import get_config
  10. else: # assume windows
  11. from setup_windows import get_config
  12. metadata, options = get_config()
  13. metadata['ext_modules'] = [
  14. setuptools.Extension(sources=['_mysql.c'], **options)]
  15. metadata['long_description'] = metadata['long_description'].replace(r'\n', '')
  16. setuptools.setup(**metadata)