spack/var/spack/repos/builtin/packages/py-editdistance/package.py
Harmen Stoppels eef9939c21
Automated git version fixes (#39637)
Use full length commit sha instead of short prefixes, to improve
reproducibility (future clashes) and guard against compromised repos and
man in the middle attacks.

Abbreviated commit shas are expanded to full length, to guard against future
clashes on short hash. It also guards against compromised repos and
man in the middle attacks, where attackers can easily fabricate a malicious
commit with a shasum prefix collision.

Versions with just tags now also get a commit sha, which can later be used to
check for retagged commits.
2023-08-29 16:33:03 +02:00

26 lines
1.0 KiB
Python

# Copyright 2013-2023 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)
from spack.package import *
class PyEditdistance(PythonPackage):
"""Fast implementation of the edit distance (Levenshtein distance)."""
homepage = "https://github.com/aflc/editdistance"
pypi = "editdistance/editdistance-0.4.tar.gz"
git = "https://github.com/roy-ht/editdistance.git"
maintainers("meyersbs")
# PyPI tarball for version 0.6.2 missing bycython.pyx file
# https://github.com/roy-ht/editdistance/issues/94#issuecomment-1426279375
version("0.6.2", tag="v0.6.2", commit="3f5a5b0299f36662349df0917352a42c620e3dd4")
version("0.4", sha256="c765db6f8817d38922e4a50be4b9ab338b2c539377b6fcf0bca11dea72eeb8c1")
depends_on("py-setuptools", type="build")
depends_on("py-cython", when="@0.6.2:", type="build")
depends_on("python@3.6:", when="@0.6.2:", type=("build", "run"))