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.9 KiB

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