Repository: spack/spack

Issue:
maintainers are passed when using cuda
When using the cuda build system, the maintainers are passed through to the package in the output of `spack info`. This began with ~~#15301~~ #15031, but that is probably only because that PR added the `maintainers` field to the cuda build system. The cuda build system lists the following maintainers:

```console
$ git grep maintainers lib/spack/spack/build_systems/
lib/spack/spack/build_systems/cuda.py:    maintainers = ['ax3l', 'svenevs']
```

When using the cuda build system, such as in a mixin, those are propagated.
```console
$ spack info gpu-burn | grep Maintainers
Maintainers: @ax3l @svenevs
```
even though no maintainers are listed in the gpu-burn package.


Discussion:
@glennpj I think the PR you are referring to is #15031 not #15301
@ax3l @svenevs 
@alalazo Yes, thank you.
I'd rather not be default maintainer on anything using CUDA, only brought in if it's actually a CUDA issue.

```diff
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 5c4ff23d4..b0f55eb9d 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -204,6 +204,11 @@ def _flush_callbacks(check_name):
         _flush_callbacks('run_before')
         _flush_callbacks('run_after')
 
+        # Do not forward maintainers to child packages.  CudaPackage is the only
+        # build system package with maintainers at this time.
+        if name == 'CudaPackage':
+            attr_dict['maintainers'] = []
+
         return super(PackageMeta, cls).__new__(cls, name, bases, attr_dict)
 
     @staticmethod

```

However, `py-pip` doesn't have any maintainers, if `person` became maintainer of `PythonPackage` then we'll hit the same thing and would need to specialize that too.  Is there a way to detect instead if the "child package" itself?  If so, then we don't need to special-case:

```py
# Do not forward package base / build system maintainers to child packages.
if magic_condition_states_its_child_most_package():  # e.g., it's gpu-burn
    if 'maintainers' not in attr_dict:
        attr_dict['maintainers'] = []
```

The `attr_dict['__module__']` is `spack.pkg.builtin.gpu-burn`, is checking if that attribute `startswith('spack.pkg.builtin.')` sufficient?

There are 3969 packages without explicit `maintainers` right now if I grepped correctly.  Adding an empty `maintainers = []` to everything (and having `spack create` do an uncommented version) seems like way too significant of an effort, but that's another way around it.
I would rather keep the ability to pass maintainers through from the build system in case I ever go crazy and decide to maintain every Python package 😄 

What if we simply comment out `maintainers` in `CudaPackage`? That way no one will be automatically notified once my maintainer bot lands, but we'll still know who to contact by inspecting the build system?
I agree with Adam, let's not special case the treatment of the `maintainers` attribute in `CudaPackage`. 

> What if we simply comment out maintainers in CudaPackage? That way no one will be automatically notified once my maintainer bot lands, but we'll still know who to contact by inspecting the build system?

Can't we remove `maintainers` completely and add a note to `CudaPackage` docstring:
```python
class CudaPackage(PackageBase):
    """Auxiliary class which contains CUDA variant, dependencies and conflicts
    and is meant to unify and facilitate its usage.

    In case of emergency call: 111-@ax3l-@svenevs
    """
```
or more seriously:
```python
class CudaPackage(PackageBase):
    """Auxiliary class which contains CUDA variant, dependencies and conflicts
    and is meant to unify and facilitate its usage.

    maintainers: ax3l, svenevs
    """
```
?

Resolving patch:
diff --git a/lib/spack/spack/build_systems/cuda.py b/lib/spack/spack/build_systems/cuda.py
--- a/lib/spack/spack/build_systems/cuda.py
+++ b/lib/spack/spack/build_systems/cuda.py
@@ -12,8 +12,9 @@
 class CudaPackage(PackageBase):
     """Auxiliary class which contains CUDA variant, dependencies and conflicts
     and is meant to unify and facilitate its usage.
+
+    Maintainers: ax3l, svenevs
     """
-    maintainers = ['ax3l', 'svenevs']
 
     # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list
     # https://developer.nvidia.com/cuda-gpus


Test patch: