py-natsort: add new variant +icu and dependent package (#48907)

* Add new package py-pyicu to support new py-natsort variant +icu

* note version req location

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

* bound icu variant

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
This commit is contained in:
Chris Marsh 2025-02-26 10:42:13 -06:00 committed by GitHub
parent 3d63fe91b0
commit bad28e7f9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View File

@ -37,3 +37,7 @@ class PyNatsort(PythonPackage):
version("4.0.1", sha256="1c1d29150938ca71f0943363a06765dbb2cea01f9c4d760ba880cc65f39baba0")
depends_on("py-setuptools", type=("build"))
variant("icu", default=False, when="@5.0.3:", description="Use icu for locale sorting")
depends_on("py-pyicu", type=("build", "run"), when="+icu")

View File

@ -0,0 +1,25 @@
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyPyicu(PythonPackage):
"""Python extension wrapping the ICU C++ API"""
homepage = "https://gitlab.pyicu.org/main/pyicu"
pypi = "PyICU/PyICU-2.14.tar.gz"
maintainers("Chrismarsh")
license("MIT", checked_by="Chrismarsh")
version("2.14", sha256="acc7eb92bd5c554ed577249c6978450a4feda0aa6f01470152b3a7b382a02132")
depends_on("cxx", type="build")
depends_on("py-setuptools", type="build")
depends_on("pkgconfig", type="build")
depends_on("icu4c@:76") # ICU_MAX_MAJOR_VERSION in setup.py