spacepaste

  1.  
  2. """A setuptools based setup module.
  3. See:
  4. https://packaging.python.org/en/latest/distributing.html
  5. https://github.com/pypa/sampleproject
  6. """
  7. # Always prefer setuptools over distutils
  8. from setuptools import setup, find_packages, Extension
  9. from setuptools.command.develop import develop
  10. from setuptools.command.install import install
  11. # To use a consistent encoding
  12. from codecs import open
  13. from os import path
  14. import os
  15. from subprocess import check_call
  16. import sysconfig
  17. class PostDevelopCommand(develop):
  18. """Post-installation for development mode."""
  19. def run(self):
  20. check_call("apt-get -y install julius festival festlex-cmu python-xlib portaudio19-dev python-all-dev flac libnotify-bin python-egenix-mx-base-dev python-lxml python-nltk python-pyaudio python-httplib2 libxpm-dev".split())
  21. check_call("wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_clb_arctic-0.95-release.tar.bz2 -P /usr/share/festival/voices/english/".split())
  22. check_call("tar jxf /usr/share/festival/voices/english/cmu_us_clb_arctic-0.95-release.tar.bz2 -C /usr/share/festival/voices/english/".split())
  23. check_call("ln -fs /usr/share/festival/voices/english/cmu_us_clb_arctic /usr/share/festival/voices/english/cmu_us_clb_arctic_clunits".split())
  24. check_call("cp /etc/festival.scm /etc/festival.scm.backup".split())
  25. check_call("chmod o+w /etc/festival.scm".split())
  26. with open("/etc/festival.scm", "a") as myfile:
  27. myfile.write("(set! voice_default 'voice_cmu_us_clb_arctic_clunits)")
  28. check_call("python -m spacy download en".split())
  29. import nltk
  30. nltk.download("names")
  31. nltk.download("brown")
  32. nltk.download('wordnet')
  33. develop.run(self)
  34. class PostInstallCommand(install):
  35. """Post-installation for installation mode."""
  36. def run(self):
  37. check_call("apt-get -y install julius festival festlex-cmu python-xlib portaudio19-dev python-all-dev flac libnotify-bin python-egenix-mx-base-dev python-lxml python-nltk python-pyaudio python-httplib2 libxpm-dev".split())
  38. check_call("wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_clb_arctic-0.95-release.tar.bz2 -P /usr/share/festival/voices/english/".split())
  39. check_call("tar jxf /usr/share/festival/voices/english/cmu_us_clb_arctic-0.95-release.tar.bz2 -C /usr/share/festival/voices/english/".split())
  40. check_call("ln -fs /usr/share/festival/voices/english/cmu_us_clb_arctic /usr/share/festival/voices/english/cmu_us_clb_arctic_clunits".split())
  41. check_call("cp /etc/festival.scm /etc/festival.scm.backup".split())
  42. check_call("chmod o+w /etc/festival.scm".split())
  43. with open("/etc/festival.scm", "a") as myfile:
  44. myfile.write("(set! voice_default 'voice_cmu_us_clb_arctic_clunits)")
  45. check_call("python -m spacy download en".split())
  46. import nltk
  47. nltk.download("names")
  48. nltk.download("brown")
  49. nltk.download('wordnet')
  50. install.run(self)
  51. here = path.abspath(path.dirname(__file__))
  52. # Get the long description from the README file
  53. with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
  54. long_description = f.read()
  55. cflags = sysconfig.get_config_var('CFLAGS').split()
  56. cflags += ['-g']
  57. ldflags = sysconfig.get_config_var('LDFLAGS').split()
  58. ldflags += ['-L/usr/X11R6/lib', '-lXpm', '-lXext', '-lX11', '-lm']
  59. setup(
  60. name='dragonfire',
  61. # Versions should comply with PEP440. For a discussion on single-sourcing
  62. # the version across setup.py and the project code, see
  63. # https://packaging.python.org/en/latest/single_source_version.html
  64. version='0.9.4',
  65. description='Dragonfire is an open source virtual assistant project for Ubuntu based Linux distributions',
  66. long_description=long_description,
  67. # The project's main homepage.
  68. url='https://github.com/mertyildiran/Dragonfire',
  69. # Author details
  70. author='Mehmet Mert Yildiran',
  71. author_email='mert.yildiran@bil.omu.edu.tr',
  72. # Choose your license
  73. license='MIT',
  74. # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
  75. classifiers=[
  76. # How mature is this project? Common values are
  77. # 3 - Alpha
  78. # 4 - Beta
  79. # 5 - Production/Stable
  80. 'Development Status :: 3 - Alpha',
  81. # Indicate who your project is intended for
  82. 'Intended Audience :: Developers',
  83. 'Topic :: Scientific/Engineering :: Human Machine Interfaces',
  84. # Pick your license as you wish (should match "license" above)
  85. 'License :: OSI Approved :: MIT License',
  86. # Intended language
  87. 'Natural Language :: English',
  88. # Target Operating System
  89. 'Operating System :: POSIX :: Linux',
  90. # Specify the Python versions you support here. In particular, ensure
  91. # that you indicate whether you support Python 2, Python 3 or both.
  92. 'Programming Language :: Python :: 2.7',
  93. ],
  94. # What does your project relate to?
  95. keywords='virtual assistant machine learining artifical intelligence chat bot',
  96. # You can just specify the packages manually here if your project is
  97. # simple. Or you can use find_packages().
  98. packages=find_packages(),
  99. # Alternatively, if you want to distribute just a my_module.py, uncomment
  100. # this:
  101. # py_modules=["my_module"],
  102. # List run-time dependencies here. These will be installed by pip when
  103. # your project is installed. For an analysis of "install_requires" vs pip's
  104. # requirements files see:
  105. # https://packaging.python.org/en/latest/requirements.html
  106. install_requires=['wikipedia','PyUserInput','google-api-python-client','SpeechRecognition','tinydb','youtube_dl','spacy'],
  107. # List additional groups of dependencies here (e.g. development
  108. # dependencies). You can install these using the following syntax,
  109. # for example:
  110. # $ pip install -e .[dev,test]
  111. extras_require={
  112. 'optionals': ['egenix-mx-base','lxml','nltk','pyaudio','httplib2>=0.9.1']
  113. },
  114. # If there are data files included in your packages that need to be
  115. # installed, specify them here. If using Python 2.6 or less, then these
  116. # have to be included in MANIFEST.in as well.
  117. package_data={
  118. # If any package contains *.txt files, include them:
  119. '': ['*.txt'],
  120. '': ['*.ini'],
  121. '': ['*.jconf'],
  122. '': ['*.dfa'],
  123. '': ['*.dict'],
  124. '': ['*.grammar'],
  125. '': ['*.term'],
  126. '': ['*.voca'],
  127. '': ['*.aiml'],
  128. },
  129. # Although 'package_data' is the preferred approach, in some case you may
  130. # need to place data files outside of your packages. See:
  131. # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
  132. # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
  133. data_files=[],
  134. # To provide executable scripts, use entry points in preference to the
  135. # "scripts" keyword. Entry points provide cross-platform support and allow
  136. # pip to create the appropriate form of executable for the target platform.
  137. entry_points={
  138. 'console_scripts': [
  139. 'dragonfire=dragonfire:initiate',
  140. ],
  141. },
  142. #cmdclass={
  143. # 'develop': PostDevelopCommand,
  144. # 'install': PostInstallCommand,
  145. #},
  146. ext_modules=[Extension('realhud',
  147. ['dragonfire/realhud/realhud.c'],
  148. extra_compile_args=cflags,
  149. extra_link_args=ldflags
  150. )
  151. ]
  152. )
  153.