setup.py 1.4 KB

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