From 904455497efb7a643948b0ba7befc33c797366da Mon Sep 17 00:00:00 2001
From: "Christopher J. Markiewicz" <markiewicz@stanford.edu>
Date: Wed, 8 May 2019 17:05:27 -0400
Subject: [PATCH] MAINT: Require networkx<2.3 for Python 2

---
 nipype/info.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/nipype/info.py b/nipype/info.py
index 380c7f5a04..06077286d6 100644
--- a/nipype/info.py
+++ b/nipype/info.py
@@ -101,6 +101,7 @@ def get_nipype_gitversion():
 # versions
 NIBABEL_MIN_VERSION = '2.1.0'
 NETWORKX_MIN_VERSION = '1.9'
+NETWORKX_MAX_VERSION_27 = '2.2'
 NUMPY_MIN_VERSION = '1.9.0'
 # Numpy bug in python 3.7:
 # https://www.opensourceanswers.com/blog/you-shouldnt-use-python-37-for-data-science-right-now.html
@@ -135,7 +136,8 @@ def get_nipype_gitversion():
 PROVIDES = ['nipype']
 REQUIRES = [
     'nibabel>=%s' % NIBABEL_MIN_VERSION,
-    'networkx>=%s' % NETWORKX_MIN_VERSION,
+    'networkx>=%s,<=%s ; python_version < "3.0"' % (NETWORKX_MIN_VERSION, NETWORKX_MAX_VERSION_27),
+    'networkx>=%s ; python_version >= "3.0"' % NETWORKX_MIN_VERSION,
     'numpy>=%s,!=%s ; python_version == "2.7"' % (NUMPY_MIN_VERSION, NUMPY_BAD_VERSION_27),
     'numpy>=%s ; python_version > "3.0" and python_version < "3.7"' % NUMPY_MIN_VERSION,
     'numpy>=%s ; python_version >= "3.7"' % NUMPY_MIN_VERSION_37,