PageRenderTime 39ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/setup.py

https://github.com/Deepwalker/mongomodels
Python | 88 lines | 81 code | 6 blank | 1 comment | 6 complexity | db841866a579ce2251127bd21c0446c2 MD5 | raw file
  1. #!/usr/bin/env python
  2. import sys
  3. import os
  4. try:
  5. import subprocess
  6. has_subprocess = True
  7. except:
  8. has_subprocess = False
  9. import shutil
  10. from ez_setup import use_setuptools
  11. use_setuptools()
  12. from setuptools import setup
  13. from setuptools import Feature
  14. from distutils.cmd import Command
  15. from distutils.command.build_ext import build_ext
  16. from distutils.errors import CCompilerError
  17. from distutils.errors import DistutilsPlatformError, DistutilsExecError
  18. from distutils.core import Extension
  19. import mongodbobject
  20. requirements = []
  21. try:
  22. import pymongo
  23. except ImportError:
  24. requirements.append("pymongo")
  25. version = 0.1
  26. f = open("README.md")
  27. try:
  28. try:
  29. readme_content = f.read()
  30. except:
  31. readme_content = ""
  32. finally:
  33. f.close()
  34. class GenerateDoc(Command):
  35. user_options = []
  36. def initialize_options(self):
  37. pass
  38. def finalize_options(self):
  39. pass
  40. def run(self):
  41. path = "doc/%s" % version
  42. shutil.rmtree("doc", ignore_errors=True)
  43. os.makedirs(path)
  44. if has_subprocess:
  45. subprocess.call(["epydoc", "--config", "epydoc-config", "-o", path])
  46. else:
  47. print """
  48. `setup.py doc` is not supported for this version of Python.
  49. Please ask in the user forums for help.
  50. """
  51. # thanks to mike from mongodb for the setup.py template
  52. setup(
  53. name="mongodbobject",
  54. version=version,
  55. description="Object wrapper for Pymongo",
  56. long_description=readme_content,
  57. author="Marc Boeker | ONchestra.com",
  58. author_email="marc.boeker@onchestra.com",
  59. url="http://github.com/marcboeker/mongodb-object",
  60. packages=["mongodbobject"],
  61. install_requires=requirements,
  62. license="Apache License, Version 2.0",
  63. #test_suite="nose.collector",
  64. classifiers=[
  65. "Development Status :: 4 - Beta",
  66. "Intended Audience :: Developers",
  67. "License :: OSI Approved :: Apache Software License",
  68. "Operating System :: MacOS :: MacOS X",
  69. "Operating System :: Microsoft :: Windows",
  70. "Operating System :: POSIX",
  71. "Programming Language :: Python",
  72. "Topic :: Database"],
  73. cmdclass={"doc": GenerateDoc})