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.
 
 
 

166 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.rst', '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://hyde.github.com',
  99. packages=find_packages(),
  100. requires=['python (>= 2.7)'],
  101. install_requires=(
  102. 'fswrap==0.1.1',
  103. 'commando==0.3.2a',
  104. 'PyYAML==3.10',
  105. 'Markdown==2.3.1',
  106. 'MarkupSafe==0.15',
  107. 'Pygments==1.6',
  108. 'typogrify==2.0.0',
  109. 'Jinja2==2.6'
  110. ),
  111. tests_require=(
  112. 'nose', 'mock'
  113. ),
  114. test_suite='nose.collector',
  115. include_package_data = True,
  116. # Scan the input for package information
  117. # to grab any data files (text, images, etc.)
  118. # associated with sub-packages.
  119. package_data = find_package_data(PROJECT,
  120. package=PROJECT,
  121. only_in_packages=False,
  122. ),
  123. entry_points={
  124. 'console_scripts': [
  125. 'hyde = hyde.main:main'
  126. ]
  127. },
  128. license='MIT',
  129. classifiers=[
  130. 'Development Status :: 4 - Beta',
  131. 'Environment :: Console',
  132. 'Intended Audience :: End Users/Desktop',
  133. 'Intended Audience :: Developers',
  134. 'Intended Audience :: System Administrators',
  135. 'License :: OSI Approved :: MIT License',
  136. 'Operating System :: MacOS :: MacOS X',
  137. 'Operating System :: Unix',
  138. 'Operating System :: POSIX',
  139. 'Operating System :: Microsoft :: Windows',
  140. 'Programming Language :: Python',
  141. 'Topic :: Software Development',
  142. 'Topic :: Software Development :: Build Tools',
  143. 'Topic :: Software Development :: Code Generators',
  144. 'Topic :: Internet',
  145. 'Topic :: Internet :: WWW/HTTP :: Site Management',
  146. ],
  147. zip_safe=False,
  148. )