New package: py-x21 (#30225)

* Py-x21 now works, needs dependencies

Conflicts:
	var/spack/repos/rit-rc/packages/py-x21/package.py

* Added dependencies to py-x21

* Making flake style check happy

* [py-x21] flake8

* [py-x21]

- added homepage
- added placeholder description
- added comment about checksums

* [py-x21] added darwin support and fixed issue with python 3.7 wheel name

* [py-x21] adding checksum hash

* [py-x21] removed duplicate py-pynacl

* [py-x21]

- updated description
- updated version listing to have a different version for each version
  of python. Also, versions dependent on sys.platform
- updated url_for_version to not require post concretized information so
  that spack checksum works

* [py-x21] isort

Co-authored-by: vehrc <vehrc@rit.edu>
This commit is contained in:
Jen Herting 2022-05-24 14:12:48 -04:00 committed by GitHub
parent 6a57aede57
commit 494e567fe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,66 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import *
class PyX21(PythonPackage):
"""Used for unpacking this author's obfuscated libraries"""
homepage = "https://pypi.org/project/x21/"
list_url = "https://pypi.org/simple/x21/"
def url_for_version(self, version):
url = "https://pypi.io/packages/cp{1}/x/x21/x21-{0}-cp{1}-cp{1}{2}-{3}.whl"
if sys.platform == 'darwin':
platform_string = "macosx_10_9_x86_64"
elif sys.platform.startswith('linux'):
platform_string = "manylinux_2_17_x86_64.manylinux2014_x86_64"
py_ver = Version(version.string.split('y')[1])
return url.format(version.string.split('-')[0],
py_ver.joined,
'm' if py_ver == Version('3.7') else '',
platform_string)
if sys.platform == 'darwin':
version('0.2.6-py3.7',
sha256='7367b7c93fba520e70cc29731baec5b95e7be32d7615dad4f1f034cd21c194bd',
expand=False)
version('0.2.6-py3.8',
sha256='bbbfdb6b56562ecc81f0dc39e009713157011fbb50d47353eb25f633acf77204',
expand=False)
version('0.2.6-py3.9',
sha256='d7b4f06a71ac27d05ae774752b3ca396134916427f371b5995b07f0f43205043',
expand=False)
version('0.2.6-py3.10',
sha256='2cbda690757f1fc80edfe48fcb13f168068f1784f0cb8c300a0d8051714d0452',
expand=False)
elif sys.platform.startswith('linux'):
version('0.2.6-py3.7',
sha256='8b35248d0b049dd09985d1a45c6fa36dd39db2c9d805a96028ec3bf9dc80e0dd',
expand=False)
version('0.2.6-py3.8',
sha256='64275052bcda784395bc613f750b8b5a6b1ddbfa4e7a590cb8e209543f0ca0c4',
expand=False)
version('0.2.6-py3.9',
sha256='e20b29650fcbf0be116ac93511033bf10debc76261b7350e018ff91b92ff950d',
expand=False)
version('0.2.6-py3.10',
sha256='7c5c58ff6dc81caac6815578f78cf545e719beb0bf4017f77120d38025d2bc7d',
expand=False)
depends_on('python@3.7.0:3.7', type=('build', 'run'), when='@0.2.6-py3.7')
depends_on('python@3.8.0:3.8', type=('build', 'run'), when='@0.2.6-py3.8')
depends_on('python@3.9.0:3.9', type=('build', 'run'), when='@0.2.6-py3.9')
depends_on('python@3.10.0:3.10', type=('build', 'run'), when='@0.2.6-py3.10')
depends_on('py-pynacl', type=('build', 'run'))
depends_on('py-setuptools', type=('build', 'run'))
depends_on('py-tomli', type=('build', 'run'))
depends_on('py-tomli-w', type=('build', 'run'))