Repository: spack/spack

Issue:
Installation issue: nest
<!-- Thanks for taking the time to report this build failure. To proceed with the report please:

1. Title the issue "Installation issue: <name-of-the-package>".
2. Provide the information required below.

We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install nest@master

==> nest: Executing phase: 'cmake'
==> Error: KeyError: 'No spec with name py-cython in nest@master%gcc@10.3.0+gsl~ipo~modules+mpi+openmp+optimize~python+shared build_type=RelWithDebInfo arch=linux-centos8-zen2 ^autoconf@2.69%gcc@10.3.0 arch=linux-centos8-zen2 ^automake@1.16.3%gcc@10.3.0 arch=linux-centos8-zen2 ^berkeley-db@18.1.40%gcc@10.3.0+cxx~docs+stl patches=b231fcc4d5cff05e5c3a4814f6a5af0e9a966428dc2176540d2c05aff41de522 arch=linux-centos8-zen2 ^bison@3.7.4%gcc@10.3.0 arch=linux-centos8-zen2 ^bzip2@1.0.8%gcc@10.3.0+shared arch=linux-centos8-zen2 ^cmake@3.20.1%gcc@10.3.0~doc+ncurses+openssl+ownlibs~qt build_type=Release arch=linux-centos8-zen2 ^diffutils@3.7%gcc@10.3.0 arch=linux-centos8-zen2 ^doxygen@1.9.1%gcc@10.3.0~graphviz~ipo~mscgen build_type=RelWithDebInfo arch=linux-centos8-zen2 ^expat@2.3.0%gcc@10.3.0+libbsd arch=linux-centos8-zen2 ^findutils@4.8.0%gcc@10.3.0 arch=linux-centos8-zen2 ^flex@2.6.4%gcc@10.3.0+lex patches=09c22e5c6fef327d3e48eb23f0d610dcd3a35ab9207f12e0f875701c677978d3 arch=linux-centos8-zen2 ^gdbm@1.19%gcc@10.3.0 arch=linux-centos8-zen2 ^gettext@0.21%gcc@10.3.0+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-centos8-zen2 ^gsl@2.6%gcc@10.3.0~external-cblas arch=linux-centos8-zen2 ^help2man@1.47.16%gcc@10.3.0 arch=linux-centos8-zen2 ^hwloc@2.4.1%gcc@10.3.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml+pci+shared arch=linux-centos8-zen2 ^libbsd@0.11.3%gcc@10.3.0 arch=linux-centos8-zen2 ^libedit@3.1-20210216%gcc@10.3.0 arch=linux-centos8-zen2 ^libevent@2.1.12%gcc@10.3.0+openssl arch=linux-centos8-zen2 ^libffi@3.3%gcc@10.3.0 patches=26f26c6f29a7ce9bf370ad3ab2610f99365b4bdd7b82e7c31df41a3370d685c0 arch=linux-centos8-zen2 ^libiconv@1.16%gcc@10.3.0 arch=linux-centos8-zen2 ^libmd@1.0.3%gcc@10.3.0 arch=linux-centos8-zen2 ^libpciaccess@0.16%gcc@10.3.0 arch=linux-centos8-zen2 ^libsigsegv@2.13%gcc@10.3.0 arch=linux-centos8-zen2 ^libtool@2.4.6%gcc@10.3.0 arch=linux-centos8-zen2 ^libxml2@2.9.10%gcc@10.3.0~python arch=linux-centos8-zen2 ^m4@1.4.18%gcc@10.3.0+sigsegv patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 arch=linux-centos8-zen2 ^ncurses@6.2%gcc@10.3.0~symlinks+termlib abi=none arch=linux-centos8-zen2 ^numactl@2.0.14%gcc@10.3.0 patches=4e1d78cbbb85de625bad28705e748856033eaafab92a66dffd383a3d7e00cc94,62fc8a8bf7665a60e8f4c93ebbd535647cebf74198f7afafec4c085a8825c006 arch=linux-centos8-zen2 ^openmpi@4.0.5%gcc@10.3.0~atomics~cuda~cxx~cxx_exceptions+gpfs~internal-hwloc~java~legacylaunchers~lustre~memchecker~pmi~singularity~sqlite3+static~thread_multiple+vt+wrapper-rpath fabrics=none patches=60ce20bc14d98c572ef7883b9fcd254c3f232c2f3a13377480f96466169ac4c8 schedulers=none arch=linux-centos8-zen2 ^openssh@8.5p1%gcc@10.3.0 arch=linux-centos8-zen2 ^openssl@1.1.1k%gcc@10.3.0~docs+systemcerts arch=linux-centos8-zen2 ^perl@5.32.1%gcc@10.3.0+cpanm+shared+threads arch=linux-centos8-zen2 ^pkgconf@1.7.4%gcc@10.3.0 arch=linux-centos8-zen2 ^python@3.8.9%gcc@10.3.0+bz2+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tix~tkinter~ucs4+uuid+zlib patches=0d98e93189bc278fbc37a50ed7f183bd8aaf249a8e1670a465f0db6bb4f8cf87 arch=linux-centos8-zen2 ^readline@8.1%gcc@10.3.0 arch=linux-centos8-zen2 ^sqlite@3.35.4%gcc@10.3.0+column_metadata+fts~functions~rtree arch=linux-centos8-zen2 ^tar@1.34%gcc@10.3.0 arch=linux-centos8-zen2 ^util-linux-uuid@2.36.2%gcc@10.3.0 arch=linux-centos8-zen2 ^util-macros@1.19.1%gcc@10.3.0 arch=linux-centos8-zen2 ^xz@5.2.5%gcc@10.3.0~pic arch=linux-centos8-zen2 ^zlib@1.2.11%gcc@10.3.0+optimize+pic+shared arch=linux-centos8-zen2'

/p/scratch/cjzam11/kitayama1/projects/spack/var/spack/repos/builtin/packages/nest/package.py:111, in cmake_args:
        108        if '+python':
        109            version = self.spec['python'].version[0]
        110            args.append('-Dwith-python={0}'.format(version))
  >>    111            args.append('-Dcythonize-pynest=' + self.spec['py-cython'].prefix)
        112        else:
        113            args.append('-Dwith-python=OFF')
        114            args.append('-Dcythonize-pynest=OFF')
```

### Information on your system

<!-- Please include the output of `spack debug report` -->

<!-- If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well. -->

### 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-out.txt]()
* [spack-build-env.txt]()

<!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [ ] 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
- [ ] I have uploaded the build log and environment files
- [ ] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
On my branch, the package.py is changed so that Python is default to False, but it keeps branch into the `+python` case.
No one shows up as maintainers.
@heplesser, @jougs 
```
if '+python':
```

Is always true. It should be changed to

```
if '+python' in self.spec:
```

Do you think you would be able to submit a PR for the fix?

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/nest/package.py b/var/spack/repos/builtin/packages/nest/package.py
--- a/var/spack/repos/builtin/packages/nest/package.py
+++ b/var/spack/repos/builtin/packages/nest/package.py
@@ -14,7 +14,9 @@ class Nest(CMakePackage):
 
     homepage = "http://www.nest-simulator.org"
     url      = "https://github.com/nest/nest-simulator/releases/download/v2.12.0/nest-2.12.0.tar.gz"
+    git      = "https://github.com/nest/nest-simulator.git"
 
+    version('master', branch='master')
     version('2.20.0', sha256='40e33187c22d6e843d80095b221fa7fd5ebe4dbc0116765a91fc5c425dd0eca4')
     version('2.14.0', sha256='d6316d6c9153100a3220488abfa738958c4b65bf2622bd15540e4aa81e79f17f')
     version('2.12.0', sha256='bac578f38bb0621618ee9d5f2f1febfee60cddc000ff32e51a5f5470bb3df40d')
@@ -23,7 +25,7 @@ class Nest(CMakePackage):
     version('2.6.0',  sha256='5fe4924bc57d0c7dd820aa371de935eedf7e813832c0eee2c976b33c9a8db4cf')
     version('2.4.2',  sha256='8f86e58c1a12b733ffabd8b0400326e5a3494a458149ea8ebe9f19674d05b91b')
 
-    variant('python', default=True,
+    variant('python', default=False,
             description='Build the PyNest interface')
     variant('mpi', default=True,
             description='Build with MPI bindings')
@@ -103,7 +105,7 @@ def cmake_args(self):
         else:
             args.append('-Dwith-mpi=OFF')
 
-        if '+python':
+        if '+python' in self.spec:
             version = self.spec['python'].version[0]
             args.append('-Dwith-python={0}'.format(version))
             args.append('-Dcythonize-pynest=' + self.spec['py-cython'].prefix)


Test patch: