diff --git a/.gitignore b/.gitignore index 1da0cba..d0306f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /editdistance-0.5.3.tar.gz /editdistance-0.6.0.tar.gz /editdistance-0.6.2.tar.gz +/editdistance-0.8.1.tar.gz diff --git a/python-editdistance.spec b/python-editdistance.spec index 9b040a5..5d919d7 100644 --- a/python-editdistance.spec +++ b/python-editdistance.spec @@ -1,12 +1,13 @@ Name: python-editdistance -Version: 0.6.2 +Version: 0.8.1 Release: %autorelease Summary: Fast implementation of the edit distance (Levenshtein distance) # SPDX License: MIT -URL: https://github.com/aflc/editdistance -Source0: %{url}/archive/v%{version}/editdistance-%{version}.tar.gz +URL: https://github.com/roy-ht/editdistance +# The PyPI sdist lacks tests, so we use the GitHub archive. +Source: %{url}/archive/v%{version}/editdistance-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: gcc-c++ @@ -35,9 +36,7 @@ Summary: %{summary} %autosetup -n editdistance-%{version} # Remove files generated by Cython to regenerate them; note that -# editdistance/_editdistance.cpp is not generated code. As of 0.6.2, generated -# sources are not committed to git and are therefore not included in the GitHub -# source archives, so we retain this line only as a precaution. +# editdistance/_editdistance.cpp is not generated code. grep -rl '/\* Generated by Cython' | xargs -r rm -v @@ -51,7 +50,18 @@ grep -rl '/\* Generated by Cython' | xargs -r rm -v %install %pyproject_install -%pyproject_save_files -l editdistance +%pyproject_save_files -L editdistance + +# 0.8.1: pep517 based build packages some files which should not be packaged +# and compile time warnings +# https://github.com/roy-ht/editdistance/issues/112 +# “I couldn’t find any documentation on how to control this with the PDM build +# backend, so I worked around it downstream rather than offering a PR to fix it +# properly.” +find %{buildroot}%{python3_sitearch} -type f \( \ + -name '.git*' -o -name '*.cpp' -o -name '*.h' \ + \) -print -delete +sed -r -i '/\.(cpp|h)/d' %{pyproject_files} %check @@ -59,7 +69,8 @@ grep -rl '/\* Generated by Cython' | xargs -r rm -v %files -n python3-editdistance -f %{pyproject_files} -%doc README.rst +%license LICENSE +%doc README.md %changelog diff --git a/sources b/sources index 4d8fb5e..9618b66 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (editdistance-0.6.2.tar.gz) = 8d44d310351c688180fb783d87922a954427618793fa6d15e1d231b4cf0efafd9ecfdfbbcf4453021ad189870d01eb72ea3ba4de57f333ffbb157bb4b8529cd2 +SHA512 (editdistance-0.8.1.tar.gz) = 2e8c01d6414c82ecb06f03c756938e099be2b36134705ebe302a38fea1f914a43c698c620bc6be0e9cc628b71c7c8bf8d069ea38e186945bd717e366108ddc3c