PageRenderTime 63ms CodeModel.GetById 34ms RepoModel.GetById 0ms app.codeStats 0ms

/setup.py

https://github.com/samuraisam/pycassa
Python | 117 lines | 107 code | 7 blank | 3 comment | 6 complexity | e49e820bcd2abec8c46d17b73c8c55db MD5 | raw file
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import sys
  5. import os
  6. try:
  7. import subprocess
  8. has_subprocess = True
  9. except:
  10. has_subprocess = False
  11. try:
  12. from ez_setup import use_setuptools
  13. use_setuptools()
  14. except ImportError:
  15. pass
  16. try:
  17. from setuptools import setup
  18. except ImportError:
  19. from distutils.core import setup
  20. from distutils.cmd import Command
  21. import pycassa
  22. __version__ = '.'.join(map(str, pycassa.version))
  23. long_description = """pycassa is a python client library for Apache Cassandra with the following features:
  24. 1. Auto-failover single or thread-local connections
  25. 2. Connection pooling
  26. 3. A batch interface
  27. 4. Simplified version of the Thrift interface
  28. 5. A method to map an existing class to a Cassandra column family
  29. """
  30. class doc(Command):
  31. description = "generate or test documentation"
  32. user_options = [("test", "t",
  33. "run doctests instead of generating documentation")]
  34. boolean_options = ["test"]
  35. def initialize_options(self):
  36. self.test = False
  37. def finalize_options(self):
  38. pass
  39. def run(self):
  40. if self.test:
  41. path = "doc/_build/doctest"
  42. mode = "doctest"
  43. else:
  44. path = "doc/_build/%s" % __version__
  45. mode = "html"
  46. try:
  47. os.makedirs(path)
  48. except:
  49. pass
  50. if has_subprocess:
  51. status = subprocess.call(["sphinx-build", "-b", mode, "doc", path])
  52. if status:
  53. raise RuntimeError("documentation step '%s' failed" % mode)
  54. print ""
  55. print "Documentation step '%s' performed, results here:" % mode
  56. print " %s/" % path
  57. else:
  58. print """
  59. `setup.py doc` is not supported for this version of Python.
  60. Please ask in the user forums for help.
  61. """
  62. setup(
  63. name = 'pycassa',
  64. version = __version__,
  65. author = 'Jonathan Hseu',
  66. author_email = 'vomjom AT vomjom.net',
  67. maintainer = 'Tyler Hobbs',
  68. maintainer_email = 'pycassa.maintainer@gmail.com',
  69. description = 'Python client library for Apache Cassandra',
  70. long_description = long_description,
  71. url = 'http://github.com/pycassa/pycassa',
  72. download_url = 'http://github.com/downloads/pycassa/pycassa/pycassa-%s.tar.gz' % __version__,
  73. keywords = 'cassandra client db distributed thrift',
  74. packages = ['pycassa',
  75. 'pycassa.cassandra',
  76. 'pycassa.cassandra.c07',
  77. 'pycassa.cassandra.c08',
  78. 'pycassa.logging'],
  79. requires = ['thrift'],
  80. py_modules=['ez_setup'],
  81. scripts=['pycassaShell'],
  82. cmdclass={"doc": doc},
  83. classifiers=[
  84. 'Development Status :: 5 - Production/Stable',
  85. 'Intended Audience :: Developers',
  86. 'License :: OSI Approved :: MIT License',
  87. 'Natural Language :: English',
  88. 'Operating System :: OS Independent',
  89. 'Programming Language :: Python :: 2.4',
  90. 'Programming Language :: Python :: 2.5',
  91. 'Programming Language :: Python :: 2.6',
  92. 'Programming Language :: Python :: 2.7',
  93. 'Topic :: Software Development :: Libraries :: Python Modules'
  94. ]
  95. )