More correctly unbundle flexcache

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.
This commit is contained in:
Benjamin A. Beasley
2023-10-31 16:45:15 -04:00
parent 44323f33dc
commit 799b93479a
+3 -2
View File
@@ -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