Jean-Paul Calderone | cf20dd6 | 2008-06-12 16:38:38 -0400 | [diff] [blame] | 1 | #!/usr/bin/env python |
Jean-Paul Calderone | 0db6cdb | 2008-04-11 11:52:15 -0400 | [diff] [blame] | 2 | # -*- coding: utf-8 -*- |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 3 | # |
Hynek Schlawack | 76ecf94 | 2015-04-14 11:09:44 -0400 | [diff] [blame] | 4 | # Copyright (C) Jean-Paul Calderone 2008-2015, All rights reserved |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 5 | # |
Jean-Paul Calderone | e53ccf7 | 2008-04-11 11:40:39 -0400 | [diff] [blame] | 6 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 7 | """ |
| 8 | Installation script for the OpenSSL module |
| 9 | """ |
| 10 | |
Hynek Schlawack | f982efd | 2015-04-15 12:08:54 -0400 | [diff] [blame^] | 11 | import sys |
| 12 | |
Jean-Paul Calderone | 5d97b41 | 2014-01-10 14:09:20 -0500 | [diff] [blame] | 13 | from setuptools import setup |
Hynek Schlawack | f982efd | 2015-04-15 12:08:54 -0400 | [diff] [blame^] | 14 | from setuptools.command.test import test as TestCommand |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 15 | |
Hynek Schlawack | 76ecf94 | 2015-04-14 11:09:44 -0400 | [diff] [blame] | 16 | |
Jean-Paul Calderone | ba4308e | 2010-07-27 20:56:32 -0400 | [diff] [blame] | 17 | # XXX Deduplicate this |
Hynek Schlawack | 197bda9 | 2015-04-14 18:51:01 -0400 | [diff] [blame] | 18 | __version__ = '0.15.1' |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 19 | |
Hynek Schlawack | f982efd | 2015-04-15 12:08:54 -0400 | [diff] [blame^] | 20 | |
| 21 | class PyTest(TestCommand): |
| 22 | user_options = [("pytest-args=", "a", "Arguments to pass to py.test")] |
| 23 | |
| 24 | def initialize_options(self): |
| 25 | TestCommand.initialize_options(self) |
| 26 | self.pytest_args = None |
| 27 | |
| 28 | def finalize_options(self): |
| 29 | TestCommand.finalize_options(self) |
| 30 | self.test_args = [] |
| 31 | self.test_suite = True |
| 32 | |
| 33 | def run_tests(self): |
| 34 | # import here, cause outside the eggs aren't loaded |
| 35 | import pytest |
| 36 | errno = pytest.main(self.pytest_args or [] + |
| 37 | ["OpenSSL"]) |
| 38 | sys.exit(errno) |
| 39 | |
| 40 | |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 41 | setup(name='pyOpenSSL', version=__version__, |
Jean-Paul Calderone | e0d94c8 | 2009-07-21 11:12:52 -0400 | [diff] [blame] | 42 | packages = ['OpenSSL'], |
Jean-Paul Calderone | 024375a | 2010-07-27 20:37:50 -0400 | [diff] [blame] | 43 | package_dir = {'OpenSSL': 'OpenSSL'}, |
Jean-Paul Calderone | 1ac2c19 | 2013-12-31 20:16:13 -0500 | [diff] [blame] | 44 | py_modules = ['OpenSSL.__init__', |
| 45 | 'OpenSSL.tsafe', |
Jean-Paul Calderone | 8210b92 | 2013-02-09 09:03:18 -0800 | [diff] [blame] | 46 | 'OpenSSL.rand', |
Jean-Paul Calderone | 1ac2c19 | 2013-12-31 20:16:13 -0500 | [diff] [blame] | 47 | 'OpenSSL.crypto', |
| 48 | 'OpenSSL.SSL', |
| 49 | 'OpenSSL.version', |
| 50 | 'OpenSSL.test.__init__', |
Jean-Paul Calderone | 0b88b6a | 2009-07-05 12:44:41 -0400 | [diff] [blame] | 51 | 'OpenSSL.test.util', |
Jean-Paul Calderone | 30c09ea | 2008-03-21 17:04:05 -0400 | [diff] [blame] | 52 | 'OpenSSL.test.test_crypto', |
Rick Dean | 433dc64 | 2009-07-07 13:11:55 -0500 | [diff] [blame] | 53 | 'OpenSSL.test.test_rand', |
Hynek Schlawack | b164859 | 2015-04-13 22:18:25 -0400 | [diff] [blame] | 54 | 'OpenSSL.test.test_ssl', |
| 55 | 'OpenSSL.test.test_tsafe', |
| 56 | 'OpenSSL.test.test_util',], |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 57 | description = 'Python wrapper module around the OpenSSL library', |
Jean-Paul Calderone | 1ac2c19 | 2013-12-31 20:16:13 -0500 | [diff] [blame] | 58 | author = 'Jean-Paul Calderone', |
| 59 | author_email = 'exarkun@twistedmatrix.com', |
Jean-Paul Calderone | e53ccf7 | 2008-04-11 11:40:39 -0400 | [diff] [blame] | 60 | maintainer = 'Jean-Paul Calderone', |
| 61 | maintainer_email = 'exarkun@twistedmatrix.com', |
Jean-Paul Calderone | 324c643 | 2014-01-09 15:34:08 -0500 | [diff] [blame] | 62 | url = 'https://github.com/pyca/pyopenssl', |
Jean-Paul Calderone | 9820bba | 2011-03-02 19:02:33 -0500 | [diff] [blame] | 63 | license = 'APL2', |
Jean-Paul Calderone | 7cf3b47 | 2015-01-18 18:35:40 -0500 | [diff] [blame] | 64 | install_requires=["cryptography>=0.7", "six>=1.5.2"], |
Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame] | 65 | long_description = """\ |
| 66 | High-level wrapper around a subset of the OpenSSL library, includes |
| 67 | * SSL.Connection objects, wrapping the methods of Python's portable |
| 68 | sockets |
| 69 | * Callbacks written in Python |
| 70 | * Extensive error-handling mechanism, mirroring OpenSSL's error codes |
Jean-Paul Calderone | d59d3bc | 2011-12-19 13:32:29 -0500 | [diff] [blame] | 71 | ... and much more ;)""", |
| 72 | classifiers = [ |
| 73 | 'Development Status :: 6 - Mature', |
| 74 | 'Intended Audience :: Developers', |
| 75 | 'License :: OSI Approved :: Apache Software License', |
| 76 | 'Operating System :: MacOS :: MacOS X', |
| 77 | 'Operating System :: Microsoft :: Windows', |
| 78 | 'Operating System :: POSIX', |
Jean-Paul Calderone | 1674313 | 2014-03-03 09:12:06 -0500 | [diff] [blame] | 79 | |
| 80 | # General classifiers to indicate "this project supports Python 2" and |
| 81 | # "this project supports Python 3". |
| 82 | 'Programming Language :: Python :: 2', |
| 83 | # In particular, this makes pyOpenSSL show up on |
| 84 | # https://pypi.python.org/pypi?:action=browse&c=533&show=all and is in |
| 85 | # accordance with |
| 86 | # http://docs.python.org/2/howto/pyporting.html#universal-bits-of-advice |
| 87 | 'Programming Language :: Python :: 3', |
| 88 | |
| 89 | # More specific classifiers to indicate more precisely which versions |
| 90 | # of those languages the project supports. |
Jean-Paul Calderone | d59d3bc | 2011-12-19 13:32:29 -0500 | [diff] [blame] | 91 | 'Programming Language :: Python :: 2.6', |
| 92 | 'Programming Language :: Python :: 2.7', |
| 93 | 'Programming Language :: Python :: 3.2', |
Jean-Paul Calderone | 19ad371 | 2014-01-09 20:40:46 -0500 | [diff] [blame] | 94 | 'Programming Language :: Python :: 3.3', |
Jean-Paul Calderone | 1674313 | 2014-03-03 09:12:06 -0500 | [diff] [blame] | 95 | |
Jean-Paul Calderone | d59d3bc | 2011-12-19 13:32:29 -0500 | [diff] [blame] | 96 | 'Programming Language :: Python :: Implementation :: CPython', |
| 97 | 'Programming Language :: Python :: Implementation :: PyPy', |
| 98 | 'Topic :: Security :: Cryptography', |
| 99 | 'Topic :: Software Development :: Libraries :: Python Modules', |
| 100 | 'Topic :: System :: Networking', |
Jean-Paul Calderone | 11bf4b9 | 2014-01-11 07:30:42 -0500 | [diff] [blame] | 101 | ], |
Hynek Schlawack | f982efd | 2015-04-15 12:08:54 -0400 | [diff] [blame^] | 102 | test_suite="OpenSSL", |
| 103 | tests_require=[ |
| 104 | "pytest", |
| 105 | ], |
| 106 | cmdclass={ |
| 107 | "test": PyTest, |
| 108 | }) |