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