Repository: spack/spack

Issue:
Installation issue: py-ipython error re missing backcall dep while building py-ipykernel
I was trying to build py-ipykernel@5.3.4, using py-ipykernel@7.3.0, and I got errors in the build from ipython scripts complaining about the backcall module not being found.

I believe this is an error in the ipython recipe.  Ipython recipe makes py-backcall a dependency for ipython@7.5.0: but not 7.3.0.
As such, I had py-ipython@7.3.0 installed but no py-backcall installed.

I think the depends_on clause should include ipython@7.3.0: as 
$INSTALLDIR/lib/python3.7/site-packages/IPython/core/events.py contains an import line from backcall even in 7.3.0 case.


### Steps to reproduce the issue


```console
$ spack install py-ipykernel@5.3.4%gcc@8.4.0
...
==> Installing py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr
==> No binary for py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr found: installing from source
==> Fetching https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/_source-cache/archive/9b/9b2652af1607986a1b231c62302d070bc0534f564c393a5d9d130db9abbbe89d.tar.gz
==> No patches needed for py-ipykernel
==> py-ipykernel: Executing phase: 'build'
==> py-ipykernel: Executing phase: 'install'
==> Error: ProcessError: Command exited with status 1:
    '/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/python-3.7.7-mhx467yzopgzum7dt76cedvua6wkji3b/bin/python3.7' '-s' 'setup.py' '--no-user-cfg' 'install' '--prefix=/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr' '--single-version-externally-managed' '--root=/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr' '--install-purelib=lib/python3.7/site-packages' '--install-platlib=lib/python3.7/site-packages' '--install-scripts=bin' '--install-data=' '--install-headers=include/python3.7m'
See build log for details:
  /lustre/jn10/devspackswinst/spack-stage/spack-stage-py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr/spack-build-out.txt
```
The spack-build-out.txt ends with
```console
==> py-ipykernel: Executing phase: 'install'
==> [2021-06-11-06:45:43.934976] '/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/python-3.7.7-mhx467yzopgzum7dt76cedvua6wkji3b/bin/python3.7' '-c' 'import distutils.sysconfig;print(distutils.sysconfig.get_python_lib(plat_specific=False, prefix=""));print(distutils.sysconfig.get_python_lib(plat_specific=True, prefix=""));print(distutils.sysconfig.get_python_inc(plat_specific=True, prefix=""))'
==> [2021-06-11-06:45:43.994479] '/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/python-3.7.7-mhx467yzopgzum7dt76cedvua6wkji3b/bin/python3.7' '-s' 'setup.py' '--no-user-cfg' 'install' '--prefix=/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr' '--single-version-externally-managed' '--root=/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr' '--install-purelib=lib/python3.7/site-packages' '--install-platlib=lib/python3.7/site-packages' '--install-scripts=bin' '--install-data=' '--install-headers=include/python3.7m'
Traceback (most recent call last):
  File "setup.py", line 117, in <module>
    from ipykernel.kernelspec import write_kernel_spec, make_ipkernel_cmd, KERNEL_NAME
  File "/lustre/jn10/devspackswinst/spack-stage/spack-stage-py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr/spack-src/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/lustre/jn10/devspackswinst/spack-stage/spack-stage-py-ipykernel-5.3.4-mpcwjtwwuafiyvfw5gf2sbjjpqbqstyr/spack-src/ipykernel/connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipython-7.3.0-46hrqevpmzpe7btwqb2eyfi2ngyigbxw/lib/python3.7/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipython-7.3.0-46hrqevpmzpe7btwqb2eyfi2ngyigbxw/lib/python3.7/site-packages/IPython/terminal/embed.py", line 15, in <module>
    from IPython.core.interactiveshell import DummyMod, InteractiveShell
  File "/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipython-7.3.0-46hrqevpmzpe7btwqb2eyfi2ngyigbxw/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 43, in <module>
    from IPython.core.events import EventManager, available_events
  File "/software/spack-software/2021.04.28/linux-rhel8-x86_64/gcc-8.4.0/py-ipython-7.3.0-46hrqevpmzpe7btwqb2eyfi2ngyigbxw/lib/python3.7/site-packages/IPython/core/events.py", line 16, in <module>
    from backcall import callback_prototype
ModuleNotFoundError: No module named 'backcall'
```

### Information on your system

```console
> spack debug report
* **Spack:** 0.16.1-2429-f5e6c32495
* **Python:** 3.6.8
* **Platform:** linux-rhel8-x86_64
* **Concretizer:** original
```

### Additional information

<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. -->

* [spack-build-env.txt](https://github.com/spack/spack/files/6639623/spack-build-env.txt)
* [spack-build-out.txt](https://github.com/spack/spack/files/6639624/spack-build-out.txt

Maintainer: @adamjstewart

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [ x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [ x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [ x] I have uploaded the build log and environment files
- [ x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-ipython/package.py b/var/spack/repos/builtin/packages/py-ipython/package.py
--- a/var/spack/repos/builtin/packages/py-ipython/package.py
+++ b/var/spack/repos/builtin/packages/py-ipython/package.py
@@ -48,7 +48,7 @@ class PyIpython(PythonPackage):
     depends_on('py-prompt-toolkit@2.0.0:2.0.999', when='@7.5.0', type=('build', 'run'))
     depends_on('py-prompt-toolkit@3.0.2:3.0.999', when='@7.18:', type=('build', 'run'))
     depends_on('py-pygments', type=('build', 'run'))
-    depends_on('py-backcall', type=('build', 'run'), when='@7.5.0:')
+    depends_on('py-backcall', type=('build', 'run'), when='@7.3.0:')
     depends_on('py-pexpect', type=('build', 'run'))
     depends_on('py-pexpect@4.3:', type=('build', 'run'), when='@7.18:')
     depends_on('py-appnope', type=('build', 'run'), when='platform=darwin')


Test patch: