From 799b93479ac79a9829fec2dd81f6b2e13e170709 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 31 Oct 2023 16:45:15 -0400 Subject: [PATCH] More correctly unbundle flexcache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old approach works, but the exact replacement for pint._vendor.flexcache should be flexcache.flexcache, not just flexcache. Furthermore, this correctly replaces “from pint._vendor” if that appears in the test suite. --- python-pint.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python-pint.spec b/python-pint.spec index f4d8ce5..a1cc74b 100644 --- a/python-pint.spec +++ b/python-pint.spec @@ -74,10 +74,11 @@ sed -r -i 's/^setup_requires/install_requires = appdirs; flexcache\n&/' \ # The find-then-modify pattern keeps us from discarding mtimes on sources that # do not need modification. find pint -type f -exec \ - gawk '/^from \.+_vendor import (appdirs|flexcache)/ { + gawk '/^from (\.*|pint)\._vendor import (appdirs|flexcache)/ { print FILENAME; nextfile }' '{}' '+' | xargs -r -t sed -r -i \ - 's/^from \.+_vendor (import (appdirs|flexcache))/\1/' + -e 's/^from (\.*|pint)\._vendor (import (appdirs))/\2/' \ + -e 's/^(from )(\.*|pint)\._vendor( import (flexcache))/\1\4\3/' %generate_buildrequires # We omit the “uncertainties” extra because python-uncertainties is not yet