Alex Gaynor | 5951f46 | 2014-11-16 09:08:42 -0800 | [diff] [blame] | 1 | # This file is dual licensed under the terms of the Apache License, Version |
| 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository |
| 3 | # for complete details. |
Alex Gaynor | c37feed | 2014-03-08 08:32:56 -0800 | [diff] [blame] | 4 | |
| 5 | from __future__ import absolute_import, division, print_function |
| 6 | |
Alex Gaynor | f51f2c1 | 2014-01-03 07:33:01 -0800 | [diff] [blame] | 7 | import os |
Terry Chia | 361545d | 2014-07-28 12:06:54 +0800 | [diff] [blame] | 8 | import platform |
Alex Stapleton | a39a319 | 2014-03-14 20:03:12 +0000 | [diff] [blame] | 9 | import subprocess |
Alex Stapleton | 707b008 | 2014-04-20 22:24:41 +0100 | [diff] [blame] | 10 | import sys |
Alex Stapleton | 4b610cc | 2014-03-22 08:49:35 +0000 | [diff] [blame] | 11 | from distutils.command.build import build |
Alex Stapleton | a39a319 | 2014-03-14 20:03:12 +0000 | [diff] [blame] | 12 | |
| 13 | import pkg_resources |
Alex Gaynor | 9a00f05 | 2014-01-02 13:09:34 -0800 | [diff] [blame] | 14 | |
Paul Kehrer | afc1ccd | 2014-03-19 11:49:32 -0400 | [diff] [blame] | 15 | from setuptools import find_packages, setup |
Sascha Peilicke | c549205 | 2014-03-31 17:59:37 +0200 | [diff] [blame] | 16 | from setuptools.command.install import install |
Alex Gaynor | acac6a6 | 2014-03-04 15:24:03 -0800 | [diff] [blame] | 17 | from setuptools.command.test import test |
Donald Stufft | 446a457 | 2013-08-11 17:38:13 -0400 | [diff] [blame] | 18 | |
Paul Kehrer | afc1ccd | 2014-03-19 11:49:32 -0400 | [diff] [blame] | 19 | |
Alex Gaynor | 7630d6c | 2014-01-03 07:34:43 -0800 | [diff] [blame] | 20 | base_dir = os.path.dirname(__file__) |
Donald Stufft | c62a78c | 2014-11-07 19:17:08 -0500 | [diff] [blame] | 21 | src_dir = os.path.join(base_dir, "src") |
| 22 | |
| 23 | # When executing the setup.py, we need to be able to import ourselves, this |
| 24 | # means that we need to add the src/ directory to the sys.path. |
| 25 | sys.path.insert(0, src_dir) |
Alex Gaynor | 7630d6c | 2014-01-03 07:34:43 -0800 | [diff] [blame] | 26 | |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 27 | about = {} |
Donald Stufft | c62a78c | 2014-11-07 19:17:08 -0500 | [diff] [blame] | 28 | with open(os.path.join(src_dir, "cryptography", "__about__.py")) as f: |
Alex Gaynor | 7630d6c | 2014-01-03 07:34:43 -0800 | [diff] [blame] | 29 | exec(f.read(), about) |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 30 | |
| 31 | |
Terry Chia | da5dca8 | 2014-07-27 12:27:52 +0800 | [diff] [blame] | 32 | SETUPTOOLS_DEPENDENCY = "setuptools" |
Paul Kehrer | 7fcaa37 | 2014-01-10 23:39:58 -0600 | [diff] [blame] | 33 | CFFI_DEPENDENCY = "cffi>=0.8" |
Paul Kehrer | c024255 | 2013-09-10 18:54:13 -0500 | [diff] [blame] | 34 | SIX_DEPENDENCY = "six>=1.4.1" |
Alex Stapleton | a39a319 | 2014-03-14 20:03:12 +0000 | [diff] [blame] | 35 | VECTORS_DEPENDENCY = "cryptography_vectors=={0}".format(about['__version__']) |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 36 | |
Alex Gaynor | 91f119e | 2014-01-02 13:12:59 -0800 | [diff] [blame] | 37 | requirements = [ |
Paul Kehrer | a98f95a | 2014-11-27 09:55:17 -1000 | [diff] [blame] | 38 | "pyasn1", |
Terry Chia | da5dca8 | 2014-07-27 12:27:52 +0800 | [diff] [blame] | 39 | SIX_DEPENDENCY, |
| 40 | SETUPTOOLS_DEPENDENCY |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 41 | ] |
| 42 | |
Paul Kehrer | 5bea5ca | 2014-12-18 07:42:27 -0600 | [diff] [blame] | 43 | if sys.version_info < (3, 4): |
| 44 | requirements.append("enum34") |
| 45 | |
Julian Berman | 4cf3811 | 2015-02-24 10:51:53 -0500 | [diff] [blame^] | 46 | if platform.python_implementation() != "PyPy": |
| 47 | requirements.append(CFFI_DEPENDENCY) |
| 48 | |
Paul Kehrer | 7ad18bc | 2014-03-26 13:13:38 -0600 | [diff] [blame] | 49 | # If you add a new dep here you probably need to add it in the tox.ini as well |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 50 | test_requirements = [ |
| 51 | "pytest", |
| 52 | "pretend", |
Alex Stapleton | 0bd20e2 | 2014-03-14 19:58:07 +0000 | [diff] [blame] | 53 | "iso8601", |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 54 | ] |
| 55 | |
Alex Stapleton | a39a319 | 2014-03-14 20:03:12 +0000 | [diff] [blame] | 56 | # If there's no vectors locally that probably means we are in a tarball and |
| 57 | # need to go and get the matching vectors package from PyPi |
| 58 | if not os.path.exists(os.path.join(base_dir, "vectors/setup.py")): |
| 59 | test_requirements.append(VECTORS_DEPENDENCY) |
| 60 | |
Alex Gaynor | 9a00f05 | 2014-01-02 13:09:34 -0800 | [diff] [blame] | 61 | |
Terry Chia | 361545d | 2014-07-28 12:06:54 +0800 | [diff] [blame] | 62 | def cc_is_available(): |
| 63 | return sys.platform == "darwin" and list(map( |
| 64 | int, platform.mac_ver()[0].split("."))) >= [10, 8, 0] |
| 65 | |
| 66 | |
| 67 | backends = [ |
| 68 | "openssl = cryptography.hazmat.backends.openssl:backend" |
| 69 | ] |
| 70 | |
| 71 | if cc_is_available(): |
| 72 | backends.append( |
| 73 | "commoncrypto = cryptography.hazmat.backends.commoncrypto:backend", |
| 74 | ) |
| 75 | |
| 76 | |
Sascha Peilicke | c549205 | 2014-03-31 17:59:37 +0200 | [diff] [blame] | 77 | def get_ext_modules(): |
| 78 | from cryptography.hazmat.bindings.commoncrypto.binding import ( |
| 79 | Binding as CommonCryptoBinding |
| 80 | ) |
| 81 | from cryptography.hazmat.bindings.openssl.binding import ( |
| 82 | Binding as OpenSSLBinding |
| 83 | ) |
| 84 | from cryptography.hazmat.primitives import constant_time, padding |
| 85 | |
| 86 | ext_modules = [ |
Donald Stufft | d1b70f3 | 2014-11-07 17:48:49 -0500 | [diff] [blame] | 87 | OpenSSLBinding.ffi.verifier.get_extension(), |
Sascha Peilicke | c549205 | 2014-03-31 17:59:37 +0200 | [diff] [blame] | 88 | constant_time._ffi.verifier.get_extension(), |
| 89 | padding._ffi.verifier.get_extension() |
| 90 | ] |
Terry Chia | 361545d | 2014-07-28 12:06:54 +0800 | [diff] [blame] | 91 | if cc_is_available(): |
Donald Stufft | d1b70f3 | 2014-11-07 17:48:49 -0500 | [diff] [blame] | 92 | ext_modules.append(CommonCryptoBinding.ffi.verifier.get_extension()) |
Sascha Peilicke | c549205 | 2014-03-31 17:59:37 +0200 | [diff] [blame] | 93 | return ext_modules |
| 94 | |
| 95 | |
Paul Kehrer | 5b6ce2a | 2014-02-24 20:16:10 -0600 | [diff] [blame] | 96 | class CFFIBuild(build): |
Alex Gaynor | 4969751 | 2014-01-03 15:08:45 -0800 | [diff] [blame] | 97 | """ |
| 98 | This class exists, instead of just providing ``ext_modules=[...]`` directly |
| 99 | in ``setup()`` because importing cryptography requires we have several |
| 100 | packages installed first. |
| 101 | |
| 102 | By doing the imports here we ensure that packages listed in |
| 103 | ``setup_requires`` are already installed. |
| 104 | """ |
| 105 | |
Alex Gaynor | 9a00f05 | 2014-01-02 13:09:34 -0800 | [diff] [blame] | 106 | def finalize_options(self): |
Sascha Peilicke | c549205 | 2014-03-31 17:59:37 +0200 | [diff] [blame] | 107 | self.distribution.ext_modules = get_ext_modules() |
Alex Gaynor | 9a00f05 | 2014-01-02 13:09:34 -0800 | [diff] [blame] | 108 | build.finalize_options(self) |
| 109 | |
koobs | 92a4cdb | 2014-02-24 22:13:17 +1100 | [diff] [blame] | 110 | |
Sascha Peilicke | c549205 | 2014-03-31 17:59:37 +0200 | [diff] [blame] | 111 | class CFFIInstall(install): |
| 112 | """ |
| 113 | As a consequence of CFFIBuild and it's late addition of ext_modules, we |
| 114 | need the equivalent for the ``install`` command to install into platlib |
| 115 | install-dir rather than purelib. |
| 116 | """ |
| 117 | |
| 118 | def finalize_options(self): |
| 119 | self.distribution.ext_modules = get_ext_modules() |
| 120 | install.finalize_options(self) |
| 121 | |
| 122 | |
Alex Gaynor | acac6a6 | 2014-03-04 15:24:03 -0800 | [diff] [blame] | 123 | class PyTest(test): |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 124 | def finalize_options(self): |
Alex Gaynor | 6858cd4 | 2014-03-04 15:33:13 -0800 | [diff] [blame] | 125 | test.finalize_options(self) |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 126 | self.test_args = [] |
| 127 | self.test_suite = True |
koobs | 0667180 | 2014-02-24 22:33:07 +1100 | [diff] [blame] | 128 | |
Alex Stapleton | a39a319 | 2014-03-14 20:03:12 +0000 | [diff] [blame] | 129 | # This means there's a vectors/ folder with the package in here. |
| 130 | # cd into it, install the vectors package and then refresh sys.path |
| 131 | if VECTORS_DEPENDENCY not in test_requirements: |
Alex Gaynor | d9f9b75 | 2014-07-11 10:18:24 -0700 | [diff] [blame] | 132 | subprocess.check_call( |
| 133 | [sys.executable, "setup.py", "install"], cwd="vectors" |
| 134 | ) |
Alex Stapleton | a39a319 | 2014-03-14 20:03:12 +0000 | [diff] [blame] | 135 | pkg_resources.get_distribution("cryptography_vectors").activate() |
| 136 | |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 137 | def run_tests(self): |
koobs | 92a4cdb | 2014-02-24 22:13:17 +1100 | [diff] [blame] | 138 | # Import here because in module scope the eggs are not loaded. |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 139 | import pytest |
Alex Gaynor | 8a58e69 | 2015-02-20 07:58:39 -0800 | [diff] [blame] | 140 | test_args = [os.path.join(base_dir, "tests")] |
| 141 | errno = pytest.main(test_args) |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 142 | sys.exit(errno) |
| 143 | |
Alex Gaynor | 9a00f05 | 2014-01-02 13:09:34 -0800 | [diff] [blame] | 144 | |
Peter Odding | 51ec05f | 2014-07-12 01:18:35 +0200 | [diff] [blame] | 145 | def keywords_with_side_effects(argv): |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 146 | """ |
| 147 | Get a dictionary with setup keywords that (can) have side effects. |
| 148 | |
Peter Odding | 51ec05f | 2014-07-12 01:18:35 +0200 | [diff] [blame] | 149 | :param argv: A list of strings with command line arguments. |
| 150 | :returns: A dictionary with keyword arguments for the ``setup()`` function. |
| 151 | |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 152 | This setup.py script uses the setuptools 'setup_requires' feature because |
| 153 | this is required by the cffi package to compile extension modules. The |
| 154 | purpose of ``keywords_with_side_effects()`` is to avoid triggering the cffi |
Peter Odding | e914456 | 2014-07-12 03:14:55 +0200 | [diff] [blame] | 155 | build process as a result of setup.py invocations that don't need the cffi |
| 156 | module to be built (setup.py serves the dual purpose of exposing package |
| 157 | metadata). |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 158 | |
Peter Odding | e914456 | 2014-07-12 03:14:55 +0200 | [diff] [blame] | 159 | All of the options listed by ``python setup.py --help`` that print |
| 160 | information should be recognized here. The commands ``clean``, |
| 161 | ``egg_info``, ``register``, ``sdist`` and ``upload`` are also recognized. |
| 162 | Any combination of these options and commands is also supported. |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 163 | |
Peter Odding | e914456 | 2014-07-12 03:14:55 +0200 | [diff] [blame] | 164 | This function was originally based on the `setup.py script`_ of SciPy (see |
| 165 | also the discussion in `pip issue #25`_). |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 166 | |
| 167 | .. _pip issue #25: https://github.com/pypa/pip/issues/25 |
Peter Odding | 63ce5df | 2014-07-12 01:56:37 +0200 | [diff] [blame] | 168 | .. _setup.py script: https://github.com/scipy/scipy/blob/master/setup.py |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 169 | """ |
Peter Odding | e914456 | 2014-07-12 03:14:55 +0200 | [diff] [blame] | 170 | no_setup_requires_arguments = ( |
| 171 | '-h', '--help', |
| 172 | '-n', '--dry-run', |
| 173 | '-q', '--quiet', |
| 174 | '-v', '--verbose', |
| 175 | '-V', '--version', |
| 176 | '--author', |
| 177 | '--author-email', |
| 178 | '--classifiers', |
| 179 | '--contact', |
| 180 | '--contact-email', |
| 181 | '--description', |
Peter Odding | 6c1e9ef | 2014-07-14 15:50:31 +0200 | [diff] [blame] | 182 | '--egg-base', |
Peter Odding | e914456 | 2014-07-12 03:14:55 +0200 | [diff] [blame] | 183 | '--fullname', |
| 184 | '--help-commands', |
| 185 | '--keywords', |
| 186 | '--licence', |
| 187 | '--license', |
| 188 | '--long-description', |
| 189 | '--maintainer', |
| 190 | '--maintainer-email', |
| 191 | '--name', |
| 192 | '--no-user-cfg', |
| 193 | '--obsoletes', |
| 194 | '--platforms', |
| 195 | '--provides', |
| 196 | '--requires', |
| 197 | '--url', |
| 198 | 'clean', |
| 199 | 'egg_info', |
| 200 | 'register', |
| 201 | 'sdist', |
| 202 | 'upload', |
| 203 | ) |
Peter Odding | 97f4530 | 2014-07-14 21:40:35 +0200 | [diff] [blame] | 204 | |
Peter Odding | 6c1e9ef | 2014-07-14 15:50:31 +0200 | [diff] [blame] | 205 | def is_short_option(argument): |
| 206 | """Check whether a command line argument is a short option.""" |
| 207 | return len(argument) >= 2 and argument[0] == '-' and argument[1] != '-' |
Peter Odding | 97f4530 | 2014-07-14 21:40:35 +0200 | [diff] [blame] | 208 | |
Peter Odding | 6c1e9ef | 2014-07-14 15:50:31 +0200 | [diff] [blame] | 209 | def expand_short_options(argument): |
| 210 | """Expand combined short options into canonical short options.""" |
| 211 | return ('-' + char for char in argument[1:]) |
Peter Odding | 97f4530 | 2014-07-14 21:40:35 +0200 | [diff] [blame] | 212 | |
Peter Odding | 6c1e9ef | 2014-07-14 15:50:31 +0200 | [diff] [blame] | 213 | def argument_without_setup_requirements(argv, i): |
| 214 | """Check whether a command line argument needs setup requirements.""" |
| 215 | if argv[i] in no_setup_requires_arguments: |
| 216 | # Simple case: An argument which is either an option or a command |
| 217 | # which doesn't need setup requirements. |
| 218 | return True |
Peter Odding | 97f4530 | 2014-07-14 21:40:35 +0200 | [diff] [blame] | 219 | elif (is_short_option(argv[i]) and |
| 220 | all(option in no_setup_requires_arguments |
| 221 | for option in expand_short_options(argv[i]))): |
Peter Odding | 6c1e9ef | 2014-07-14 15:50:31 +0200 | [diff] [blame] | 222 | # Not so simple case: Combined short options none of which need |
| 223 | # setup requirements. |
| 224 | return True |
Peter Odding | 97f4530 | 2014-07-14 21:40:35 +0200 | [diff] [blame] | 225 | elif argv[i - 1:i] == ['--egg-base']: |
Peter Odding | 6c1e9ef | 2014-07-14 15:50:31 +0200 | [diff] [blame] | 226 | # Tricky case: --egg-info takes an argument which should not make |
| 227 | # us use setup_requires (defeating the purpose of this code). |
| 228 | return True |
| 229 | else: |
| 230 | return False |
Peter Odding | 97f4530 | 2014-07-14 21:40:35 +0200 | [diff] [blame] | 231 | |
| 232 | if all(argument_without_setup_requirements(argv, i) |
| 233 | for i in range(1, len(argv))): |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 234 | return { |
| 235 | "cmdclass": { |
| 236 | "build": DummyCFFIBuild, |
| 237 | "install": DummyCFFIInstall, |
| 238 | "test": DummyPyTest, |
| 239 | } |
| 240 | } |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 241 | else: |
Peter Odding | e327cf1 | 2014-07-12 01:18:50 +0200 | [diff] [blame] | 242 | return { |
| 243 | "setup_requires": requirements, |
| 244 | "cmdclass": { |
| 245 | "build": CFFIBuild, |
| 246 | "install": CFFIInstall, |
| 247 | "test": PyTest, |
| 248 | } |
| 249 | } |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 250 | |
| 251 | |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 252 | setup_requires_error = ("Requested setup command that needs 'setup_requires' " |
| 253 | "while command line arguments implied a side effect " |
| 254 | "free command or option.") |
| 255 | |
| 256 | |
Peter Odding | c9861f9 | 2014-07-13 04:17:20 +0200 | [diff] [blame] | 257 | class DummyCFFIBuild(build): |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 258 | """ |
| 259 | This class makes it very obvious when ``keywords_with_side_effects()`` has |
| 260 | incorrectly interpreted the command line arguments to ``setup.py build`` as |
| 261 | one of the 'side effect free' commands or options. |
| 262 | """ |
| 263 | |
Peter Odding | dcce080 | 2014-07-12 02:28:13 +0200 | [diff] [blame] | 264 | def run(self): |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 265 | raise RuntimeError(setup_requires_error) |
| 266 | |
| 267 | |
Peter Odding | c9861f9 | 2014-07-13 04:17:20 +0200 | [diff] [blame] | 268 | class DummyCFFIInstall(install): |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 269 | """ |
| 270 | This class makes it very obvious when ``keywords_with_side_effects()`` has |
| 271 | incorrectly interpreted the command line arguments to ``setup.py install`` |
| 272 | as one of the 'side effect free' commands or options. |
| 273 | """ |
| 274 | |
Peter Odding | dcce080 | 2014-07-12 02:28:13 +0200 | [diff] [blame] | 275 | def run(self): |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 276 | raise RuntimeError(setup_requires_error) |
| 277 | |
| 278 | |
Peter Odding | c9861f9 | 2014-07-13 04:17:20 +0200 | [diff] [blame] | 279 | class DummyPyTest(test): |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 280 | """ |
| 281 | This class makes it very obvious when ``keywords_with_side_effects()`` has |
| 282 | incorrectly interpreted the command line arguments to ``setup.py test`` as |
| 283 | one of the 'side effect free' commands or options. |
| 284 | """ |
| 285 | |
Peter Odding | 3ae89a5 | 2014-07-12 02:06:56 +0200 | [diff] [blame] | 286 | def run_tests(self): |
| 287 | raise RuntimeError(setup_requires_error) |
| 288 | |
| 289 | |
Alex Gaynor | 7630d6c | 2014-01-03 07:34:43 -0800 | [diff] [blame] | 290 | with open(os.path.join(base_dir, "README.rst")) as f: |
Alex Gaynor | f51f2c1 | 2014-01-03 07:33:01 -0800 | [diff] [blame] | 291 | long_description = f.read() |
| 292 | |
| 293 | |
Alex Gaynor | c62e91f | 2013-08-06 19:25:52 -0700 | [diff] [blame] | 294 | setup( |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 295 | name=about["__title__"], |
| 296 | version=about["__version__"], |
| 297 | |
| 298 | description=about["__summary__"], |
Alex Gaynor | f51f2c1 | 2014-01-03 07:33:01 -0800 | [diff] [blame] | 299 | long_description=long_description, |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 300 | license=about["__license__"], |
| 301 | url=about["__uri__"], |
| 302 | |
| 303 | author=about["__author__"], |
| 304 | author_email=about["__email__"], |
| 305 | |
Christian Heimes | f83ed1d | 2013-08-10 23:28:29 +0200 | [diff] [blame] | 306 | classifiers=[ |
Christian Heimes | f83ed1d | 2013-08-10 23:28:29 +0200 | [diff] [blame] | 307 | "Intended Audience :: Developers", |
| 308 | "License :: OSI Approved :: Apache Software License", |
Alex Gaynor | abe8bc9 | 2014-10-31 19:28:57 -0700 | [diff] [blame] | 309 | "License :: OSI Approved :: BSD License", |
Christian Heimes | f83ed1d | 2013-08-10 23:28:29 +0200 | [diff] [blame] | 310 | "Natural Language :: English", |
| 311 | "Operating System :: MacOS :: MacOS X", |
| 312 | "Operating System :: POSIX", |
| 313 | "Operating System :: POSIX :: BSD", |
| 314 | "Operating System :: POSIX :: Linux", |
| 315 | "Operating System :: Microsoft :: Windows", |
Christian Heimes | f83ed1d | 2013-08-10 23:28:29 +0200 | [diff] [blame] | 316 | "Programming Language :: Python", |
| 317 | "Programming Language :: Python :: 2", |
| 318 | "Programming Language :: Python :: 2.6", |
| 319 | "Programming Language :: Python :: 2.7", |
| 320 | "Programming Language :: Python :: 3", |
| 321 | "Programming Language :: Python :: 3.2", |
| 322 | "Programming Language :: Python :: 3.3", |
Alex Gaynor | 7f8b277 | 2014-03-17 10:22:41 -0700 | [diff] [blame] | 323 | "Programming Language :: Python :: 3.4", |
Christian Heimes | f83ed1d | 2013-08-10 23:28:29 +0200 | [diff] [blame] | 324 | "Programming Language :: Python :: Implementation :: CPython", |
| 325 | "Programming Language :: Python :: Implementation :: PyPy", |
| 326 | "Topic :: Security :: Cryptography", |
| 327 | ], |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 328 | |
Donald Stufft | c62a78c | 2014-11-07 19:17:08 -0500 | [diff] [blame] | 329 | package_dir={"": "src"}, |
| 330 | packages=find_packages(where="src", exclude=["tests", "tests.*"]), |
Alex Gaynor | e23dd3a | 2014-08-11 13:51:54 -0700 | [diff] [blame] | 331 | include_package_data=True, |
Donald Stufft | 9ebb8ff | 2013-08-11 17:05:03 -0400 | [diff] [blame] | 332 | |
Alex Gaynor | 91f119e | 2014-01-02 13:12:59 -0800 | [diff] [blame] | 333 | install_requires=requirements, |
koobs | ff0dd1e | 2014-02-24 21:55:04 +1100 | [diff] [blame] | 334 | tests_require=test_requirements, |
Donald Stufft | 5f12a1b | 2013-08-11 16:37:43 -0400 | [diff] [blame] | 335 | |
| 336 | # for cffi |
| 337 | zip_safe=False, |
Alex Gaynor | 9a00f05 | 2014-01-02 13:09:34 -0800 | [diff] [blame] | 338 | ext_package="cryptography", |
Terry Chia | da5dca8 | 2014-07-27 12:27:52 +0800 | [diff] [blame] | 339 | entry_points={ |
Terry Chia | 361545d | 2014-07-28 12:06:54 +0800 | [diff] [blame] | 340 | "cryptography.backends": backends, |
Peter Odding | c9b83f7 | 2014-07-12 00:52:58 +0200 | [diff] [blame] | 341 | }, |
Peter Odding | 51ec05f | 2014-07-12 01:18:35 +0200 | [diff] [blame] | 342 | **keywords_with_side_effects(sys.argv) |
Alex Gaynor | c62e91f | 2013-08-06 19:25:52 -0700 | [diff] [blame] | 343 | ) |