setup.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env python
  2. import sys, os
  3. from distutils.core import setup
  4. from distutils.command.install_scripts import install_scripts
  5. version = '2.0.3'
  6. class md_install_scripts(install_scripts):
  7. """ Customized install_scripts. Create markdown.bat for win32. """
  8. def run(self):
  9. install_scripts.run(self)
  10. if sys.platform == 'win32':
  11. try:
  12. script_dir = os.path.join(sys.prefix, 'Scripts')
  13. script_path = os.path.join(script_dir, 'markdown')
  14. bat_str = '@"%s" "%s" %%*' % (sys.executable, script_path)
  15. bat_path = os.path.join(self.install_dir, 'markdown.bat')
  16. f = file(bat_path, 'w')
  17. f.write(bat_str)
  18. f.close()
  19. print 'Created:', bat_path
  20. except Exception, e:
  21. print 'ERROR: Unable to create %s: %s' % (bat_path, e)
  22. data = dict(
  23. name = 'Markdown',
  24. version = version,
  25. url = 'http://www.freewisdom.org/projects/python-markdown',
  26. download_url = 'http://pypi.python.org/packages/source/M/Markdown/Markdown-%s.tar.gz' % version,
  27. description = 'Python implementation of Markdown.',
  28. author = 'Manfred Stienstra and Yuri takhteyev',
  29. author_email = 'yuri [at] freewisdom.org',
  30. maintainer = 'Waylan Limberg',
  31. maintainer_email = 'waylan [at] gmail.com',
  32. license = 'BSD License',
  33. packages = ['markdown', 'markdown.extensions'],
  34. scripts = ['bin/markdown'],
  35. cmdclass = {'install_scripts': md_install_scripts},
  36. classifiers = ['Development Status :: 5 - Production/Stable',
  37. 'License :: OSI Approved :: BSD License',
  38. 'Operating System :: OS Independent',
  39. 'Programming Language :: Python',
  40. 'Programming Language :: Python :: 2',
  41. 'Programming Language :: Python :: 2.3',
  42. 'Programming Language :: Python :: 2.4',
  43. 'Programming Language :: Python :: 2.5',
  44. 'Programming Language :: Python :: 2.6',
  45. 'Programming Language :: Python :: 3',
  46. 'Programming Language :: Python :: 3.0',
  47. 'Topic :: Communications :: Email :: Filters',
  48. 'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
  49. 'Topic :: Internet :: WWW/HTTP :: Site Management',
  50. 'Topic :: Software Development :: Documentation',
  51. 'Topic :: Software Development :: Libraries :: Python Modules',
  52. 'Topic :: Text Processing :: Filters',
  53. 'Topic :: Text Processing :: Markup :: HTML',
  54. ],
  55. zip_safe = False
  56. )
  57. if sys.version[:3] < '2.5':
  58. data['install_requires'] = ['elementtree']
  59. setup(**data)