aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2014-07-12 01:18:35 +0200
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-09-29 11:44:30 -0500
commit51ec05fc2475213ffbf8a87c5ff2e309d9a68520 (patch)
treea2d1b8d9db96e8a4acabd448fc96bc9d8d7e9f23 /setup.py
parentc9b83f7bee7e36678849d684de40331c278617fa (diff)
downloadcryptography-51ec05fc2475213ffbf8a87c5ff2e309d9a68520.tar.gz
cryptography-51ec05fc2475213ffbf8a87c5ff2e309d9a68520.tar.bz2
cryptography-51ec05fc2475213ffbf8a87c5ff2e309d9a68520.zip
Make sys.argv an argument of keywords_with_side_effects()
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 7465c31f..b0ad2db3 100644
--- a/setup.py
+++ b/setup.py
@@ -140,10 +140,13 @@ class PyTest(test):
sys.exit(errno)
-def keywords_with_side_effects():
+def keywords_with_side_effects(argv):
"""
Get a dictionary with setup keywords that (can) have side effects.
+ :param argv: A list of strings with command line arguments.
+ :returns: A dictionary with keyword arguments for the ``setup()`` function.
+
This setup.py script uses the setuptools 'setup_requires' feature because
this is required by the cffi package to compile extension modules. The
purpose of ``keywords_with_side_effects()`` is to avoid triggering the cffi
@@ -161,8 +164,8 @@ def keywords_with_side_effects():
.. _pip issue #25: https://github.com/pypa/pip/issues/25
.. _setup.py script of SciPy: https://github.com/scipy/scipy/blob/master/setup.py
"""
- if len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
- sys.argv[1] in ('--help-commands', '--version', 'clean', 'egg_info')):
+ if len(argv) >= 2 and ('--help' in argv[1:] or
+ argv[1] in ('--help-commands', '--version', 'clean', 'egg_info')):
return {}
else:
return dict(setup_requires=requirements,
@@ -221,5 +224,5 @@ setup(
entry_points={
"cryptography.backends": backends,
},
- **keywords_with_side_effects()
+ **keywords_with_side_effects(sys.argv)
)