setup.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # Do not import non-standard modules here, as it will mess up the installation in clients.
  4. import re
  5. try:
  6. from setuptools import setup
  7. except ImportError:
  8. from distutils.core import setup
  9. # with open('README.rst') as readme_file:
  10. # readme = readme_file.read()
  11. #
  12. # with open('HISTORY.rst') as history_file:
  13. # history = history_file.read().replace('.. :changelog:', '')
  14. # Read version number etc from other file
  15. # http://stackoverflow.com/questions/2058802/how-can-i-get-the-version-defined-in-setup-py-setuptools-in-my-package
  16. with open('energymeter.py') as mainfile:
  17. main_py = mainfile.read()
  18. metadata = dict( re.findall(r"__([a-z]+)__ *= *'([^']+)'", main_py) )
  19. setup(
  20. name = 'energymeter',
  21. version = metadata['version'],
  22. license = metadata['license'],
  23. author = metadata['author'],
  24. author_email = metadata['email'],
  25. url = metadata['url'],
  26. description="Wrapper for Minimalmodbus to use with ABB Energy Meters.",
  27. install_requires = ['pyserial', 'minimalmodbus', 'tinysbus'],
  28. py_modules = ['energymeter'],
  29. keywords='ABB Energy Meter Modbus'
  30. )