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.

setup.py 2.6 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/python
  2. # To release a new version, tag it:
  3. # git tag -a nilmtools-1.1 -m "Version 1.1"
  4. # git push --tags
  5. # Then just package it up:
  6. # python setup.py sdist
  7. # This is supposed to be using Distribute:
  8. #
  9. # distutils provides a "setup" method.
  10. # setuptools is a set of monkeypatches on top of that.
  11. # distribute is a particular version/implementation of setuptools.
  12. #
  13. # So we don't really know if this is using the old setuptools or the
  14. # Distribute-provided version of setuptools.
  15. import traceback
  16. import sys
  17. import os
  18. try:
  19. from setuptools import setup, find_packages
  20. import distutils.version
  21. except ImportError:
  22. traceback.print_exc()
  23. print "Please install the prerequisites listed in README.txt"
  24. sys.exit(1)
  25. # Versioneer manages version numbers from git tags.
  26. # https://github.com/warner/python-versioneer
  27. import versioneer
  28. versioneer.versionfile_source = 'src/_version.py'
  29. versioneer.versionfile_build = 'nilmtools/_version.py'
  30. versioneer.tag_prefix = 'nilmtools-'
  31. versioneer.parentdir_prefix = 'nilmtools-'
  32. # Hack to workaround logging/multiprocessing issue:
  33. # https://groups.google.com/d/msg/nose-users/fnJ-kAUbYHQ/_UsLN786ygcJ
  34. try: import multiprocessing
  35. except: pass
  36. # We need a MANIFEST.in. Generate it here rather than polluting the
  37. # repository with yet another setup-related file.
  38. with open("MANIFEST.in", "w") as m:
  39. m.write("""
  40. # Root
  41. include README.txt
  42. include setup.py
  43. include versioneer.py
  44. include Makefile
  45. """)
  46. # Run setup
  47. setup(name='nilmtools',
  48. version = versioneer.get_version(),
  49. cmdclass = versioneer.get_cmdclass(),
  50. url = 'https://git.jim.sh/jim/lees/nilmtools.git',
  51. author = 'Jim Paris',
  52. description = "NILM Database Tools",
  53. long_description = "NILM Database Tools",
  54. license = "Proprietary",
  55. author_email = 'jim@jtan.com',
  56. install_requires = [ 'nilmdb >= 1.6.0',
  57. 'numpy',
  58. 'scipy',
  59. 'matplotlib',
  60. ],
  61. packages = [ 'nilmtools',
  62. ],
  63. package_dir = { 'nilmtools': 'src' },
  64. entry_points = {
  65. 'console_scripts': [
  66. 'nilm-decimate = nilmtools.decimate:main',
  67. 'nilm-decimate-auto = nilmtools.decimate_auto:main',
  68. 'nilm-insert = nilmtools.insert:main',
  69. 'nilm-copy = nilmtools.copy_one:main',
  70. 'nilm-prep = nilmtools.prep:main',
  71. 'nilm-copy-wildcard = nilmtools.copy_wildcard:main',
  72. 'nilm-sinefit = nilmtools.sinefit:main',
  73. 'nilm-cleanup = nilmtools.cleanup:main',
  74. ],
  75. },
  76. zip_safe = False,
  77. )