New version: py-pyaml 6.0 (#27542)

This commit is contained in:
iarspider 2021-11-19 18:35:50 +01:00 committed by GitHub
parent e08ebff139
commit 0288ef8733
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,7 @@ class PyPyyaml(PythonPackage):
maintainers = ['adamjstewart']
version('6.0', sha256='68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2')
version('5.3.1', sha256='b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d')
version('5.1.2', sha256='01adf0b6c6f61bd11af6e10ca52b7d4057dd0be0343eb9283c878cf3af56aee4')
version('5.1', sha256='436bc774ecf7c103814098159fbb84c2715d25980175292c648f2da143909f95')
@ -25,7 +26,10 @@ class PyPyyaml(PythonPackage):
variant('libyaml', default=True, description='Use libYAML bindings')
depends_on('python@2.7:2.8,3.5:', type=('build', 'run'))
depends_on('python@3.6:', type=('build', 'run'), when='@6.0:')
depends_on('libyaml', when='+libyaml')
depends_on('py-setuptools', when='@6.0:')
depends_on('py-cython', when='@6.0: +libyaml')
phases = ['build_ext', 'install']
@ -39,20 +43,21 @@ def import_modules(self):
return modules
def setup_py(self, *args, **kwargs):
# Cast from tuple to list
args = list(args)
if self.spec.satisfies('@:5'):
# Cast from tuple to list
args = list(args)
if '+libyaml' in self.spec:
args.insert(0, '--with-libyaml')
else:
args.insert(0, '--without-libyaml')
if '+libyaml' in self.spec:
args.insert(0, '--with-libyaml')
else:
args.insert(0, '--without-libyaml')
super(PyPyyaml, self).setup_py(*args, **kwargs)
def build_ext_args(self, spec, prefix):
args = []
if '+libyaml' in spec:
if spec.satisfies('@:5 +libyaml'):
args.extend([
spec['libyaml'].libs.search_flags,
spec['libyaml'].headers.include_flags,