setup.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import os
  2. import shutil
  3. from setuptools import setup, find_packages, Command
  4. from asn1crypto import version
  5. class CleanCommand(Command):
  6. user_options = [
  7. ('all', 'a', '(Compatibility with original clean command)'),
  8. ]
  9. def initialize_options(self):
  10. self.all = False
  11. def finalize_options(self):
  12. pass
  13. def run(self):
  14. folder = os.path.dirname(os.path.abspath(__file__))
  15. for sub_folder in ['build', 'dist', 'asn1crypto.egg-info']:
  16. full_path = os.path.join(folder, sub_folder)
  17. if os.path.exists(full_path):
  18. shutil.rmtree(full_path)
  19. for root, dirnames, filenames in os.walk(os.path.join(folder, 'asn1crypto')):
  20. for filename in filenames:
  21. if filename[-4:] == '.pyc':
  22. os.unlink(os.path.join(root, filename))
  23. for dirname in list(dirnames):
  24. if dirname == '__pycache__':
  25. shutil.rmtree(os.path.join(root, dirname))
  26. setup(
  27. name='asn1crypto',
  28. version=version.__version__,
  29. description=(
  30. 'Fast ASN.1 parser and serializer with definitions for private keys, '
  31. 'public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, '
  32. 'PKCS#12, PKCS#5, X.509 and TSP'
  33. ),
  34. long_description='Docs for this project are maintained at https://github.com/wbond/asn1crypto#readme.',
  35. url='https://github.com/wbond/asn1crypto',
  36. author='wbond',
  37. author_email='will@wbond.net',
  38. license='MIT',
  39. classifiers=[
  40. 'Development Status :: 4 - Beta',
  41. 'Intended Audience :: Developers',
  42. 'License :: OSI Approved :: MIT License',
  43. 'Programming Language :: Python :: 2.6',
  44. 'Programming Language :: Python :: 2.7',
  45. 'Programming Language :: Python :: 3.2',
  46. 'Programming Language :: Python :: 3.3',
  47. 'Programming Language :: Python :: 3.4',
  48. 'Programming Language :: Python :: 3.5',
  49. 'Programming Language :: Python :: 3.6',
  50. 'Programming Language :: Python :: Implementation :: PyPy',
  51. 'Topic :: Security :: Cryptography',
  52. ],
  53. keywords='asn1 crypto pki x509 certificate rsa dsa ec dh',
  54. packages=find_packages(exclude=['tests*', 'dev*']),
  55. test_suite='tests.make_suite',
  56. cmdclass={
  57. 'clean': CleanCommand,
  58. }
  59. )