Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (22 sloc) 579 Bytes
#!/usr/bin/env bash
#
# Parse the output of `pip show` to determine which Python packages use a
# specified package.
#
# Wish list:
# - optionally list usage dependencies recursively
# - operate on more than one argument
TARGET="$1"
if [ -z "$TARGET" ]; then
echo "
usage: $0 <package>
"
exit 1
fi
for package in $(pip list | awk '{print $1;}'); do
# True if the pip information for this package contains the name of the TARGET
# package under the "Requires:" section
if [ -n "$(pip show $package | grep "^Requires:.*$TARGET")" ]; then
echo "$package"
fi
done