setup.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # vim: fileencoding=utf-8
  2. import os
  3. import setuptools
  4. import sys
  5. exclude=[]
  6. if sys.version_info[0:2] < (3, 4):
  7. exclude += ['qubesadmin.tools', 'qubesadmin.tests.tools']
  8. if sys.version_info[0:2] < (3, 5):
  9. exclude += ['qubesadmin.events']
  10. # don't import: import * is unreliable and there is no need, since this is
  11. # compile time and we have source files
  12. def get_console_scripts():
  13. if sys.version_info[0:2] >= (3, 4):
  14. for filename in os.listdir('./qubesadmin/tools'):
  15. basename, ext = os.path.splitext(os.path.basename(filename))
  16. if basename in ['__init__', 'dochelpers'] or ext != '.py':
  17. continue
  18. yield '{} = qubesadmin.tools.{}:main'.format(
  19. basename.replace('_', '-'), basename)
  20. if __name__ == '__main__':
  21. setuptools.setup(
  22. name='qubesadmin',
  23. version=open('version').read().strip(),
  24. author='Invisible Things Lab',
  25. author_email='marmarek@invisiblethingslab.com',
  26. description='Qubes Admin API package',
  27. license='LGPL2.1+',
  28. url='https://www.qubes-os.org/',
  29. packages=setuptools.find_packages(exclude=exclude),
  30. entry_points={
  31. 'console_scripts': list(get_console_scripts()),
  32. 'qubesadmin.vm': [
  33. 'AppVM = qubesadmin.vm:AppVM',
  34. 'TemplateVM = qubesadmin.vm:TemplateVM',
  35. 'StandaloneVM = qubesadmin.vm:StandaloneVM',
  36. 'AdminVM = qubesadmin.vm:AdminVM',
  37. 'DispVM = qubesadmin.vm:DispVM',
  38. ],
  39. },
  40. )