Skip to content

Commit 1aba8b2

Browse files
committed
setup.py: Add version dependencies for split packages
This is especially important for recent pip where it does not upgrade dependencies by default.
1 parent b0d5b26 commit 1aba8b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/setup_py_configure.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,22 @@ def get_wheel_dependencies():
205205
regex_group_depends = \
206206
r'set\s*\(\s*ITK\_GROUP\_([a-zA-Z0-9\_\-]+)\_DEPENDS\s*([a-zA-Z0-9\_\-\s]*)\s*' # noqa: E501
207207
pattern = re.compile(regex_group_depends)
208+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
209+
from itkVersion import get_versions
210+
version = get_versions()['package-version']
208211
with open(os.path.join(SCRIPT_DIR, "..", "CMakeLists.txt"), 'r') as file_:
209212
for line in file_.readlines():
210213
match = re.search(pattern, line)
211214
if not match:
212215
continue
213216
wheel = from_group_to_wheel(match.group(1))
214217
_wheel_depends = [
215-
from_group_to_wheel(group)
218+
from_group_to_wheel(group) + '>=' + version
216219
for group in match.group(2).split()
217220
]
218221
all_depends[wheel] = _wheel_depends
219222
all_depends['itk-meta'] = [
220-
wheel_name for wheel_name in get_wheel_names()
223+
wheel_name + '>=' + version for wheel_name in get_wheel_names()
221224
if wheel_name != 'itk-meta'
222225
]
223226
all_depends['itk-meta'].append('numpy')

0 commit comments

Comments
 (0)