py-pybind11: use PythonPackage install method (#25650)

This commit is contained in:
Adam J. Stewart 2021-09-15 13:57:33 -05:00 committed by GitHub
parent 5d23638fdc
commit 0015f700b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@
from spack import *
class PyPybind11(CMakePackage):
class PyPybind11(CMakePackage, PythonPackage):
"""pybind11 -- Seamless operability between C++11 and Python.
pybind11 is a lightweight header-only library that exposes C++ types in
@ -43,13 +43,13 @@ class PyPybind11(CMakePackage):
depends_on('py-setuptools', type='build')
depends_on('py-pytest', type='test')
extends('python')
# compiler support
conflicts('%gcc@:4.7')
conflicts('%clang@:3.2')
conflicts('%intel@:16')
build_directory = '.'
def cmake_args(self):
args = []
args.append('-DPYTHON_EXECUTABLE:FILEPATH=%s'
@ -72,9 +72,8 @@ def patch(self):
string=True)
def install(self, spec, prefix):
super(PyPybind11, self).install(spec, prefix)
setup_py('install', '--single-version-externally-managed', '--root=/',
'--prefix={0}'.format(prefix))
CMakePackage.install(self, spec, prefix)
PythonPackage.install(self, spec, prefix)
@run_after('install')
@on_package_attributes(run_tests=True)