setup.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #!/usr/bin/env python
  2. #
  3. # Copyright (C) 2017 Alpha Griffin
  4. # @%@~LICENSE~@%@
  5. """Python setuptools build script.
  6. @author Ruckusist
  7. @see https://packaging.python.org/en/latest/distributing.html
  8. @see https://github.com/pypa/sampleproject
  9. Some of this script logic also taken from:
  10. https://github.com/google/protobuf
  11. """
  12. # FIXME / note to self:
  13. # read more at https://caremad.io/posts/2013/07/setup-vs-requirement/
  14. # -- to integrate fully pip
  15. # -------------------------------------------------------------------------------------
  16. #
  17. # CUSTOMIZE THIS SECTION
  18. # All the variables defined here should be customized for your project.
  19. #
  20. NS = 'dummyscript' # namespace / meta-package folder
  21. NAME = 'hammerwatch_ai' # should match source package name in NS folder
  22. REQUIRE = ['tensorflow',
  23. 'numpy',
  24. 'PIL',
  25. 'cv2'] # package dependencies
  26. DESC = 'DummyScript Starter Python Project'
  27. TAGS = 'python tensorflow ai games' # space-separated list of keywords
  28. AUTHOR = 'Ruckusist' # name or alias of author
  29. EMAIL = 'Ruckusist@alphagriffin.com' # email of author
  30. URL = 'http://dummyscript.com'
  31. LICENSE = '' # type of license
  32. COPY = '2017 Dummy Script' # copyright
  33. CLASS = [
  34. # @see https://pypi.python.org/pypi?%3Aaction=list_classifiers
  35. 'Development Status :: 4 - Beta',
  36. 'Intended Audience :: Developers',
  37. 'Natural Language :: English',
  38. 'Programming Language :: Python',
  39. 'Topic :: System :: Installation/Setup',
  40. 'Topic :: Utilities',
  41. ]
  42. #
  43. # END CUSTOMIZATION AREA
  44. # -------------------------------------------------------------------------------------
  45. #################
  46. # !!! WARNING !!!
  47. # !!! WARNING !!!
  48. #################
  49. # THINK CAREFULLY BEFORE CHANGING ANYTHING BELOW THIS LINE
  50. from setuptools import setup, find_packages, Command
  51. from codecs import open
  52. from os.path import join, splitext, dirname
  53. from os import walk
  54. from distutils.dep_util import newer
  55. def findversion(root, name):
  56. '''versioning strategy taken from http://stackoverflow.com/a/7071358/7203060'''
  57. import re
  58. vfile = join(root, name, "__version__.py")
  59. vmatch = re.search(r'^__version__ *= *["\']([^"\']*)["\']', open(vfile, "rt").read(), re.M)
  60. if vmatch:
  61. version = vmatch.group(1)
  62. print ("Found %s version %s" % (name, version))
  63. return version
  64. else:
  65. raise RuntimeError("Expecting a version string in %s." % (vfile))
  66. if __name__ == '__main__':
  67. setup(
  68. name=NAME,
  69. version=findversion(NS, NAME),
  70. license=LICENSE,
  71. namespace_packages=[NS], # home for our libraries
  72. packages=find_packages(exclude=['tests']),
  73. author=AUTHOR,
  74. author_email=EMAIL,
  75. description=DESC,
  76. long_description=open('README.rst').read(),
  77. url=URL,
  78. classifiers=CLASS,
  79. keywords=TAGS,
  80. # run-time dependencies
  81. install_requires=REQUIRE,
  82. extras_require={
  83. },
  84. package_data={
  85. },
  86. data_files=[],
  87. entry_points={
  88. },
  89. )