A fork of hyde, the static site generation. Some patches will be pushed upstream.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

169 lines
5.8 KiB

  1. # Bootstrap installation of Distribute
  2. import distribute_setup
  3. distribute_setup.use_setuptools()
  4. from setuptools import setup, find_packages
  5. from hyde.version import __version__
  6. from distutils.util import convert_path
  7. from fnmatch import fnmatchcase
  8. import os
  9. import sys
  10. PROJECT = 'hyde'
  11. try:
  12. long_description = open('README.markdown', 'rt').read()
  13. except IOError:
  14. long_description = ''
  15. ################################################################################
  16. # find_package_data is an Ian Bicking creation.
  17. # Provided as an attribute, so you can append to these instead
  18. # of replicating them:
  19. standard_exclude = ('*.py', '*.pyc', '*~', '.*', '*.bak', '*.swp*')
  20. standard_exclude_directories = ('.*', 'CVS', '_darcs', './build',
  21. './dist', 'EGG-INFO', '*.egg-info')
  22. def find_package_data(
  23. where='.', package='',
  24. exclude=standard_exclude,
  25. exclude_directories=standard_exclude_directories,
  26. only_in_packages=True,
  27. show_ignored=False):
  28. """
  29. Return a dictionary suitable for use in ``package_data``
  30. in a distutils ``setup.py`` file.
  31. The dictionary looks like::
  32. {'package': [files]}
  33. Where ``files`` is a list of all the files in that package that
  34. don't match anything in ``exclude``.
  35. If ``only_in_packages`` is true, then top-level directories that
  36. are not packages won't be included (but directories under packages
  37. will).
  38. Directories matching any pattern in ``exclude_directories`` will
  39. be ignored; by default directories with leading ``.``, ``CVS``,
  40. and ``_darcs`` will be ignored.
  41. If ``show_ignored`` is true, then all the files that aren't
  42. included in package data are shown on stderr (for debugging
  43. purposes).
  44. Note patterns use wildcards, or can be exact paths (including
  45. leading ``./``), and all searching is case-insensitive.
  46. This function is by Ian Bicking.
  47. """
  48. out = {}
  49. stack = [(convert_path(where), '', package, only_in_packages)]
  50. while stack:
  51. where, prefix, package, only_in_packages = stack.pop(0)
  52. for name in os.listdir(where):
  53. fn = os.path.join(where, name)
  54. if os.path.isdir(fn):
  55. bad_name = False
  56. for pattern in exclude_directories:
  57. if (fnmatchcase(name, pattern)
  58. or fn.lower() == pattern.lower()):
  59. bad_name = True
  60. if show_ignored:
  61. print >> sys.stderr, (
  62. "Directory %s ignored by pattern %s"
  63. % (fn, pattern))
  64. break
  65. if bad_name:
  66. continue
  67. if os.path.isfile(os.path.join(fn, '__init__.py')):
  68. if not package:
  69. new_package = name
  70. else:
  71. new_package = package + '.' + name
  72. stack.append((fn, '', new_package, False))
  73. else:
  74. stack.append((fn, prefix + name + '/', package, only_in_packages))
  75. elif package or not only_in_packages:
  76. # is a file
  77. bad_name = False
  78. for pattern in exclude:
  79. if (fnmatchcase(name, pattern)
  80. or fn.lower() == pattern.lower()):
  81. bad_name = True
  82. if show_ignored:
  83. print >> sys.stderr, (
  84. "File %s ignored by pattern %s"
  85. % (fn, pattern))
  86. break
  87. if bad_name:
  88. continue
  89. out.setdefault(package, []).append(prefix+name)
  90. return out
  91. ################################################################################
  92. setup(name=PROJECT,
  93. version=__version__,
  94. description='hyde is a static website generator',
  95. long_description = long_description,
  96. author='Lakshmi Vyas',
  97. author_email='lakshmi.vyas@gmail.com',
  98. url='http://ringce.com/hyde',
  99. packages=find_packages(),
  100. dependency_links=[
  101. "https://github.com/hyde/typogrify/tarball/hyde-setup#egg=typogrify-hyde"
  102. ],
  103. install_requires=(
  104. 'argparse',
  105. 'commando',
  106. 'jinja2',
  107. 'pyYAML',
  108. 'markdown',
  109. 'smartypants',
  110. 'pygments',
  111. 'typogrify-hyde'
  112. ),
  113. tests_require=(
  114. 'nose',
  115. ),
  116. test_suite='nose.collector',
  117. include_package_data = True,
  118. # Scan the input for package information
  119. # to grab any data files (text, images, etc.)
  120. # associated with sub-packages.
  121. package_data = find_package_data(PROJECT,
  122. package=PROJECT,
  123. only_in_packages=False,
  124. ),
  125. scripts=['main.py'],
  126. entry_points={
  127. 'console_scripts': [
  128. 'hyde = main:main'
  129. ]
  130. },
  131. license='MIT',
  132. classifiers=[
  133. 'Development Status :: 4 - Beta',
  134. 'Environment :: Console',
  135. 'Intended Audience :: End Users/Desktop',
  136. 'Intended Audience :: Developers',
  137. 'Intended Audience :: System Administrators',
  138. 'License :: OSI Approved :: MIT License',
  139. 'Operating System :: MacOS :: MacOS X',
  140. 'Operating System :: Unix',
  141. 'Operating System :: POSIX',
  142. 'Operating System :: Microsoft :: Windows',
  143. 'Programming Language :: Python',
  144. 'Topic :: Software Development',
  145. 'Topic :: Software Development :: Build Tools',
  146. 'Topic :: Software Development :: Code Generators',
  147. 'Topic :: Internet',
  148. 'Topic :: Internet :: WWW/HTTP :: Site Management',
  149. ],
  150. zip_safe=False,
  151. )