summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorManuela Kuhn <36827019+manuelakuhn@users.noreply.github.com>2022-09-18 01:02:30 +0200
committerGitHub <noreply@github.com>2022-09-17 23:02:30 +0000
commitd4c13b0f8f4534657f6148be63327c04b7b161e1 (patch)
treec4090111346994be4a81a9c8b958ab5abb56485e /var
parent2c7c749986bd2fd32ab3dcff18917cde96c798b0 (diff)
downloadspack-d4c13b0f8f4534657f6148be63327c04b7b161e1.tar.gz
spack-d4c13b0f8f4534657f6148be63327c04b7b161e1.tar.bz2
spack-d4c13b0f8f4534657f6148be63327c04b7b161e1.tar.xz
spack-d4c13b0f8f4534657f6148be63327c04b7b161e1.zip
Add skip_import to PythonPackage and use it in py-nilearn (#32664)
* Add skip_import to PythonPackage and use it in py-nilearn * Fix dependencies
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-nilearn/package.py63
1 files changed, 28 insertions, 35 deletions
diff --git a/var/spack/repos/builtin/packages/py-nilearn/package.py b/var/spack/repos/builtin/packages/py-nilearn/package.py
index 5348586bff..950b1ba33c 100644
--- a/var/spack/repos/builtin/packages/py-nilearn/package.py
+++ b/var/spack/repos/builtin/packages/py-nilearn/package.py
@@ -11,7 +11,10 @@ class PyNilearn(PythonPackage):
homepage = "https://nilearn.github.io/"
pypi = "nilearn/nilearn-0.7.1.tar.gz"
+ git = "https://github.com/nilearn/nilearn"
+ version("0.9.2", sha256="8da8d3835d92cd7b8a6cc92455a489d7e7f5994cf64fc71bce653e362773b9e4")
+ version("0.9.0", sha256="f9c8e30adef51489910aec7724b5699de178427d3ae63873dad9b23dd321fe76")
version("0.8.1", sha256="a0489940855130f35bbc4cac0750479a6f82025215ea7b1d778faca064219298")
version("0.8.0", sha256="f2d3dc81005f829f3a183efa6c90d698ea6818c06264d2e3f03e805c4340febb")
version("0.7.1", sha256="8b1409a5e1f0f6d1a1f02555c2f11115a2364f45f1e57bcb5fb3c9ea11f346fa")
@@ -25,13 +28,22 @@ class PyNilearn(PythonPackage):
variant("plotting", default=False, description="Enable plotting functionalities")
+ depends_on("py-joblib@0.15:", when="@0.9.1:", type=("build", "run"))
+ depends_on("py-joblib@0.12:", when="@0.7:", type=("build", "run"))
+ depends_on("py-joblib@0.11:", when="@0.6:", type=("build", "run"))
+ depends_on("py-lxml", when="@0.9.1:", type=("build", "run"))
+ depends_on("py-nibabel@3:", when="@0.9.1:", type=("build", "run"))
+ depends_on("py-nibabel@2.5:", when="@0.8:", type=("build", "run"))
+ depends_on("py-nibabel@2.0.2:", type=("build", "run"))
+ depends_on("py-numpy@1.18:", when="@0.9.1:", type=("build", "run"))
depends_on("py-numpy@1.16:", when="@0.8:", type=("build", "run"))
depends_on("py-numpy@1.11:", when="@0.5:", type=("build", "run"))
depends_on("py-numpy@1.6.1:", type=("build", "run"))
- depends_on("py-scipy@1.2:", when="@0.8:", type=("build", "run"))
- depends_on("py-scipy@0.19:", when="@0.6:", type=("build", "run"))
- depends_on("py-scipy@0.17:", when="@0.5:", type=("build", "run"))
- depends_on("py-scipy@0.14:", type=("build", "run"))
+ depends_on("py-pandas@1:", when="@0.9.1:", type=("build", "run"))
+ depends_on("py-pandas@0.24.0:", when="@0.8:", type=("build", "run"))
+ depends_on("py-pandas@0.18.0:", when="@0.7:", type=("build", "run"))
+ depends_on("py-requests@2:", when="@0.7:", type=("build", "run"))
+ depends_on("py-scikit-learn@0.22:", when="@0.9.1:", type=("build", "run"))
depends_on("py-scikit-learn@0.21:", when="@0.8:", type=("build", "run"))
depends_on("py-scikit-learn@0.19:", when="@0.7:", type=("build", "run"))
# sklearn.linear_model.base was deprecated in py-scikit.learn@0.24
@@ -39,43 +51,24 @@ class PyNilearn(PythonPackage):
# older py-nilearn versions use import sklearn.external.joblib which was
# deprecated in py-scikit-learn@0.23:
depends_on("py-scikit-learn@0.15:0.22", when="@:0.5", type=("build", "run"))
- depends_on("py-joblib@0.12:", when="@0.7:", type=("build", "run"))
- depends_on("py-joblib@0.11:", when="@0.6:", type=("build", "run"))
- depends_on("py-nibabel@2.5:", when="@0.8:", type=("build", "run"))
- depends_on("py-nibabel@2.0.2:", type=("build", "run"))
- depends_on("py-pandas@0.24.0:", when="@0.8:", type=("build", "run"))
- depends_on("py-pandas@0.18.0:", when="@0.7:", type=("build", "run"))
- depends_on("py-requests@2:", when="@0.7:", type=("build", "run"))
+ depends_on("py-scipy@1.5:", when="@0.9.1:", type=("build", "run"))
+ depends_on("py-scipy@1.2:", when="@0.8:", type=("build", "run"))
+ depends_on("py-scipy@0.19:", when="@0.6:", type=("build", "run"))
+ depends_on("py-scipy@0.17:", when="@0.5:", type=("build", "run"))
+ depends_on("py-scipy@0.14:", type=("build", "run"))
- depends_on("py-matplotlib@2.0:", when="@0.6: +plotting", type=("build", "run"))
+ depends_on("py-matplotlib@3:", when="@0.9.1: +plotting", type=("build", "run"))
+ depends_on("py-matplotlib@2:", when="@0.6: +plotting", type=("build", "run"))
# older py-nilearn versions use matplotlib.cm.revcmap which was deprecated
# in py-matplotlib@3.4:
- depends_on("py-matplotlib@1.1.1:3.3", when="@:0.6 +plotting", type=("build", "run"))
+ depends_on("py-matplotlib@1.5.1:3.3", when="@:0.5 +plotting", type=("build", "run"))
+ depends_on("py-matplotlib@1.1.1:3.3", when="0.4.2 +plotting", type=("build", "run"))
@property
- def import_modules(self):
- modules = [
- "nilearn",
- "nilearn.connectome",
- "nilearn.datasets",
- "nilearn.decoding",
- "nilearn.decomposition",
- "nilearn.image",
- "nilearn.input_data",
- "nilearn.masking",
- "nilearn.mass_univariate",
- "nilearn.regions",
- "nilearn.signal",
- "nilearn.surface",
- ]
-
- if self.spec.satisfies("@0.6:"):
- modules.append("nilearn.externals")
-
- if self.spec.satisfies("@0.7:"):
- modules.append("nilearn.glm")
+ def skip_modules(self):
+ modules = []
- if "+plotting" in self.spec:
+ if self.spec.satisfies("~plotting"):
modules.append("nilearn.plotting")
if self.spec.satisfies("@0.7:"):
modules.append("nilearn.reporting")