From 1ae02e950a850e3024a10401400002ff64d774d8 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 7 May 2026 09:03:19 +0300 Subject: [PATCH] Update package version to 0.27.3 --- check-version.sh | 12 +++++++++ pkg.info | 27 ++++++++++++++++--- source-files/remove-version-constraints.patch | 11 ++++++++ source.sh | 25 ++++++++++++----- 4 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 check-version.sh create mode 100644 source-files/remove-version-constraints.patch diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..023ea15 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="rapidfuzz/Levenshtein" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info index b7e4f38..ea05612 100644 --- a/pkg.info +++ b/pkg.info @@ -1,10 +1,29 @@ name: python-levenshtein description: Python extension for computing string edit distances and similarities -version: 0.27.1 -revision: 2 +version: 0.27.3 +revision: 1 url: https://github.com/rapidfuzz/Levenshtein license: GPL2-or-later +maintainers: + - enumdev@enumerated.dev architecture: any -depends: ["gcc-libs", "glibc", "python3", "python-rapidfuzz"] -make_depends: ["python-cython", "python-build", "python-installer", "python-scikit-build-core", "python-setuptools", "rapidfuzz-cpp"] type: source +depends: + - gcc-libs + - glibc + - python3=3.14.* + - python-rapidfuzz +make_depends: + - python-cython + - python-build + - python-installer + - python-scikit-build-core + - python-setuptools + - rapidfuzz-cpp +check_depends: + - python-pytest +downloads: + - url: https://github.com/rapidfuzz/Levenshtein/archive/refs/tags/v${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: bc052cc7ac742b4a2dcfb82212b157f4adce9193ed27fe4d495f1349546eecdd diff --git a/source-files/remove-version-constraints.patch b/source-files/remove-version-constraints.patch new file mode 100644 index 0000000..5784300 --- /dev/null +++ b/source-files/remove-version-constraints.patch @@ -0,0 +1,11 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,7 +1,7 @@ + [build-system] + requires = [ + "scikit-build-core>=0.11", +- "Cython>=3.1.6,<3.2.0" ++ "Cython" + ] + build-backend = "scikit_build_core.build" + diff --git a/source.sh b/source.sh index 754839f..d98bb1a 100644 --- a/source.sh +++ b/source.sh @@ -2,14 +2,13 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="https://github.com/rapidfuzz/Levenshtein/archive/refs/tags/v${BPM_PKG_VERSION}.tar.gz" -FILENAME="${DOWNLOAD##*/}" - # The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location +# This function is used for putting downloaded files to the correct location or applying patches prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + cd "$BPM_SOURCE" + + patch -Np1 -i "$BPM_WORKDIR"/remove-version-constraints.patch + sed -e 's|-m cython|-m cython --cplus|g' -i src/Levenshtein/CMakeLists.txt # Fix building with Cython 3.2 } # The build function is executed in the source directory @@ -18,10 +17,22 @@ build() { python -m build --wheel --no-isolation . } +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + + # Install module to temporary directory + python -m installer --destdir="$PWD/tmp_install" dist/*.whl + + PYTHONPATH="$PWD/tmp_install$site_packages" pytest -v +} + # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { python -m installer --destdir "$BPM_OUTPUT" --prefix=/usr dist/*.whl - install -Dm644 COPYING "$BPM_OUTPUT"/usr/share/licenses/python-levenshtein/COPYING + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/python-levenshtein/LICENSE }