setup.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env python3
  2. import re
  3. from distutils.core import setup
  4. import setup_cython
  5. def pyCythonPatchLine(line, basicOnly=False):
  6. # Patch the import statements
  7. line = re.sub(r'^(\s*from cms[0-9a-zA-Z_]*)\.([0-9a-zA-Z_\.]+) import', r'\1_cython.\2 import', line)
  8. line = re.sub(r'^(\s*from cms[0-9a-zA-Z_]*)\.([0-9a-zA-Z_\.]+) cimport', r'\1_cython.\2 cimport', line)
  9. line = re.sub(r'^(\s*import cms[0-9a-zA-Z_]*)\.', r'\1_cython.', line)
  10. line = re.sub(r'^(\s*cimport cms[0-9a-zA-Z_]*)\.', r'\1_cython.', line)
  11. line = line.replace("Python based", "Cython based")
  12. return line
  13. setup_cython.pyCythonPatchLine = pyCythonPatchLine
  14. cmdclass = {}
  15. if setup_cython.cythonBuildPossible():
  16. cmdclass["build_ext"] = setup_cython.CythonBuildExtension
  17. setup_cython.registerCythonModules()
  18. ext_modules = setup_cython.ext_modules
  19. setup( name = "cms",
  20. version = "0.0",
  21. description = "simple WSGI/Python based CMS script",
  22. license = "GNU General Public License v2 or later",
  23. author = "Michael Buesch",
  24. author_email = "m@bues.ch",
  25. url = "https://bues.ch",
  26. packages = [ "cms", ],
  27. scripts = [ "index.wsgi", "cms-cli", ],
  28. cmdclass = cmdclass,
  29. ext_modules = ext_modules,
  30. keywords = [ "CMS", "WSGI", ],
  31. classifiers = [
  32. "Development Status :: 5 - Production/Stable",
  33. "Environment :: Console",
  34. "Intended Audience :: Developers",
  35. "Intended Audience :: Other Audience",
  36. "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
  37. "Operating System :: POSIX",
  38. "Operating System :: POSIX :: Linux",
  39. "Programming Language :: Cython",
  40. "Programming Language :: Python",
  41. "Programming Language :: Python :: 3",
  42. "Programming Language :: Python :: Implementation :: CPython",
  43. "Topic :: Database",
  44. "Topic :: Database :: Database Engines/Servers",
  45. "Topic :: Database :: Front-Ends",
  46. "Topic :: Internet",
  47. "Topic :: Internet :: WWW/HTTP",
  48. "Topic :: Internet :: WWW/HTTP :: Browsers",
  49. "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
  50. "Topic :: Internet :: WWW/HTTP :: Site Management",
  51. "Topic :: Internet :: WWW/HTTP :: WSGI",
  52. "Topic :: Text Processing",
  53. "Topic :: Text Processing :: Markup :: HTML",
  54. ],
  55. long_description = "simple WSGI/Python based CMS script"
  56. )