Repository: spack/spack

Issue:
Installation issue: py-gosam
### Steps to reproduce the issue

```console
$ spack install py-gosam
```


### Error message

```
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --single-version-externally-managed not recognized
    Running setup.py install for gosam: finished with status 'error'
```

### Information on your system

* **Spack:** 0.17.1-1370-10f3113b3c
* **Python:** 3.8.10
* **Platform:** linux-ubuntu20.04-skylake_avx512
* **Concretizer:** clingo

### Additional information

Logs for Spack develop: https://gist.github.com/05e70d6f71a66a318fceb3f238264887

py-gosam installs with 0.17.0 (but only if checking the source from git, if the code is fetched from mirror the installation fails due to missing .git directory): https://gist.github.com/b47a4c577ddf8ac0ff86ad56cf2b8128



### General information

- [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:
Ping maintainer - @adamjstewart 

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-gosam/package.py b/var/spack/repos/builtin/packages/py-gosam/package.py
--- a/var/spack/repos/builtin/packages/py-gosam/package.py
+++ b/var/spack/repos/builtin/packages/py-gosam/package.py
@@ -6,7 +6,7 @@
 from spack import *
 
 
-class PyGosam(PythonPackage):
+class PyGosam(Package):
     """The package GoSam allows for the automated calculation of
        one-loop amplitudes for multi-particle processes in renormalizable
        quantum field theories."""
@@ -16,19 +16,28 @@ class PyGosam(PythonPackage):
 
     tags = ['hep']
 
-    version('2.1.1', tag='2.1.1', commit='4b98559212dfcb71f9d983a3a605e4693ac7f83f')
+    extends('python')
+
+    version('2.1.1', url="https://github.com/gudrunhe/gosam/releases/download/2.1.1/gosam-2.1.1-4b98559.tar.gz",
+            sha256="4a2b9160d51e3532025b9579a4d17d0e0f8a755b8481aeb8271c1f58eb97ab01")
     version('2.0.4', sha256='faf621c70f66d9dffc16ac5cce66258067f39f686d722a4867eeb759fcde4f44',
-            url='https://gosam.hepforge.org/downloads/?f=gosam-2.0.4-6d9f1cba.tar.gz', deprecated=True)
-    version('2.0.3', tag='v2.0.3', commit='4146ab23a06b7c57c10fb36df60758d34aa58387', deprecated=True)
+            url='https://gosam.hepforge.org/downloads/?f=gosam-2.0.4-6d9f1cba.tar.gz')
+    version('2.0.3', tag='v2.0.3', commit='4146ab23a06b7c57c10fb36df60758d34aa58387')
 
     depends_on('form', type='run')
     depends_on('qgraf', type='run')
     depends_on('gosam-contrib', type='link')
     depends_on('python@2.7.0:2.7', type=('build', 'run'), when='@:2.0.4')
     depends_on('python@3:', type=('build', 'run'), when='@2.1.1:')
-    # pip silently replaces distutils with setuptools
-    depends_on('py-setuptools', type='build')
+
+    phases = ['build', 'install']
 
     def setup_run_environment(self, env):
         gosam_contrib_lib_dir = self.spec['gosam-contrib'].prefix.lib
         env.prepend_path('LD_LIBRARY_PATH', gosam_contrib_lib_dir)
+
+    def build(self, spec, prefix):
+        python('-s', 'setup.py', '--no-user-cfg', 'build')
+
+    def install(self, spec, prefix):
+        python('-s', 'setup.py', '--no-user-cfg', 'install', '--prefix=' + prefix)


Test patch: