10000 Make numpy a build dependency. · Drulex/spinalcordtoolbox@598612f · GitHub
[go: up one dir, main page]

Skip to content

Commit 598612f

Browse files
kousuDrulex
authored andcommitted
Make numpy a build dependency.
It turns out there was a good reason for installing numpy explicitly, the line that we removed in spinalcordtoolbox#2751, because scikit-learn needs it to build from source but doesn't declare it: scikit-image/scikit-image#4919 PyPA doesn't give a clear or reliable way to declare build dependencies: some projects are using pip everywhere, some are using legacy setuptools, some distutils. It's confusing for everyone right now. They're working on it. I think we can live with double-installs, now that I have an open PR and the attention of the scikit-image maintainers (spinalcordtoolbox#2841 (comment)) we can probably expect that we can do away with this workaround sooner than later. This also moves numpy to alphabetical order and removes the misleading note about "installing first" because ordering requirements.txt got deprecated at some point (e.g. scikit-learn/scikit-learn#4164 (comment))
1 parent c043924 commit 598612f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

install_sct

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,11 @@ conda activate venv_sct
529529

530530
# Install Python dependencies
531531
print info "Installing Python dependencies..."
532+
# numpy is an undeclared build dependency: https://github.com/scikit-image/scikit-image/issues/4919
533+
# so explicitly install it as a workaround; note that in releases with requirements-freeze.txt
534+
# this can cause a strange double-install: https://github.com/neuropoly/spinalcordtoolbox/issues/2750
535+
# but we can live with that until https://github.com/scikit-image/scikit-image/pull/4920 is merged.
536+
pip install numpy
532537
# Check if a frozen version of the requirements exist (for release only)
533538
if [[ -f "requirements-freeze.txt" ]]; then
534539
print info "Using requirements-freeze.txt (release installation)"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
numpy # need to install first otherwise dependency issues
21
colored
32
dipy
43
futures
@@ -7,6 +6,7 @@ ivadomed==2.0.2
76
Keras==2.1.5
87
matplotlib
98
nibabel
9+
numpy
1010
pandas
1111
psutil
1212
pyqt5==5.11.3

0 commit comments

Comments
 (0)
0