Repository: spack/spack

Issue:
py-pyfftw import issue with scipy.fftpack
Hi,
Sorry to bother you all.
After loading the spack modules via:
```console
  spack load -r python@3.7.6
  spack load py-h5py
  spack load py-scipy
  spack load py-pyfftw
  spack load py-mpi4py
```
When in the python code I am using I try to do `import spicy_fftpack`, I have been getting an error message that ends with:

### Error Message
```python
from scipy.fftpack import (dct, idct, dst, idst, diff, tilbert, itilbert,
ImportError: cannot import name '_fftpack' from 'scipy.fftpack'
```
The full error output is in [error.txt](https://github.com/spack/spack/files/4252499/error.txt).

I think that that error is solved in the recent version of pfftw (https://github.com/pyFFTW/pyFFTW/pull/265 and https://github.com/pyFFTW/pyFFTW/issues/279).

But in my machine I still get that error.
I am not sure if I am installing py-pyfftw or py-scipy incorrectly, or making another mistake.
Or if I would just need to add an equivalent line to:
```vim
version('0.11.1', sha256='05ea28dede4c3aaaf5c66f56eb0f71849d0d50f5bc0f53ca0ffa69534af14926')
```
but for version `0.12.0`, to the package.py of py-pyfftw of spack.

Do you have any suggestion on how I can fix this issue and correctly import the library?

Thank you,
Diana

### System

 1. macOS Catalina - %clang@11.0.0-apple (but with gcc@9.2.0 fortran compilers - see compilers.yaml below)
 2. spack installed python (@3.7.6)
 3. spack installed py-scipy (@1.4.1)
 4. spack installed py-pfftw (@0.11.1)

-----

**compilers.yaml**
```vim
compilers:
- compiler:
    spec: clang@11.0.0-apple
    paths:
      cc: /usr/bin/clang
      cxx: /usr/bin/clang++
      f77: /Users/LDianaAmorim/Documents/opt/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.0-apple/gcc-9.2.0-exw25ccpcwqlkcvuwn266kvwqzxbyelp/bin/gfortran
      fc: /Users/LDianaAmorim/Documents/opt/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.0-apple/gcc-9.2.0-exw25ccpcwqlkcvuwn266kvwqzxbyelp/bin/gfortran
    flags: {}
    operating_system: catalina
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []
- compiler:
    spec: gcc@9.2.0
    paths:
      cc: /Users/LDianaAmorim/Documents/opt/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.0-apple/gcc-9.2.0-exw25ccpcwqlkcvuwn266kvwqzxbyelp/bin/gcc
      cxx: /Users/LDianaAmorim/Documents/opt/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.0-apple/gcc-9.2.0-exw25ccpcwqlkcvuwn266kvwqzxbyelp/bin/g++
      f77: /Users/LDianaAmorim/Documents/opt/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.0-apple/gcc-9.2.0-exw25ccpcwqlkcvuwn266kvwqzxbyelp/bin/gfortran
      fc: /Users/LDianaAmorim/Documents/opt/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.0-apple/gcc-9.2.0-exw25ccpcwqlkcvuwn266kvwqzxbyelp/bin/gfortran
    flags: {}
    operating_system: catalina
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []
```
-----

**packages.yaml**
```vim
packages:
  all:
    providers:
      mpi: [mpich, openmpi]
```


Discussion:
My spack repo is at commit
```vim
676eb56ab2379e4d1b3958aad382d81cb012c560 (HEAD -> develop, origin/develop, origin/HEAD)
Author: Patrick Gartung <gartung@fnal.gov>
Date:   Tue Feb 25 11:01:59 2020 -0600
...
```
> Or if I would just need to add an equivalent line to:
> ```
> version('0.11.1', sha256='05ea28dede4c3aaaf5c66f56eb0f71849d0d50f5bc0f53ca0ffa69534af14926')
> ```
> but for version 0.12.0, to the package.py of py-pyfftw of spack.

Yep, if the bug is fixed in 0.12.0, you just need to add a new version of `py-pyfftw`. You can run `spack checksum py-pyfftw 0.12.0` to get the line, then manually paste it in the package.

Would you like to submit a PR to fix this? If not, I can do it too.
Thank you for the reply @adamjstewart.
 Yes, I would like to try to do that PR!

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-pyfftw/package.py b/var/spack/repos/builtin/packages/py-pyfftw/package.py
--- a/var/spack/repos/builtin/packages/py-pyfftw/package.py
+++ b/var/spack/repos/builtin/packages/py-pyfftw/package.py
@@ -13,11 +13,12 @@ class PyPyfftw(PythonPackage):
     homepage = "http://hgomersall.github.com/pyFFTW"
     url      = "https://pypi.io/packages/source/p/pyFFTW/pyFFTW-0.10.4.tar.gz"
 
+    version('0.12.0', sha256='60988e823ca75808a26fd79d88dbae1de3699e72a293f812aa4534f8a0a58cb0')
     version('0.11.1', sha256='05ea28dede4c3aaaf5c66f56eb0f71849d0d50f5bc0f53ca0ffa69534af14926')
     version('0.10.4', sha256='739b436b7c0aeddf99a48749380260364d2dc027cf1d5f63dafb5f50068ede1a')
 
     depends_on('fftw')
-    depends_on('py-setuptools',    type='build')
-    depends_on('py-cython',        type='build')
-    depends_on('py-numpy@1.6:',    type=('build', 'run'))
-    depends_on('py-scipy@0.12.0:', type=('build', 'run'))
+    depends_on('py-setuptools',        type='build')
+    depends_on('py-cython@0.29:0.999', type='build')
+    depends_on('py-numpy@1.6:',        type=('build', 'run'), when='@:0.10.4')
+    depends_on('py-numpy@1.10:1.999',  type=('build', 'run'), when='@0.11.0:')


Test patch: