Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tiny wrapper around pip-check cmd, to run it inside venv Python first
#!/bin/bash
#
# Tiny shell script to run ``pip-check`` cmd inside of venv or fallback to
# global ``pip-check`` after.
#
# `pip-check <https://github.com/bartTC/pip-check/>`_ is a tool for checking
# outdated versions installed in your Python virtual environment or global
# site packages.
#
# Usage
# =====
#
# ::
#
# $ cd /path/to/project-with-env
# $ env-pip-check # will run env/bin/pip-check
# $ cd /path/to/project-with-tox
# $ env-pip-check # will run each available .tox/<toxenv>/bin/pip-check
# $ cd /path/to/all/projects
# $ env-pip-check # will run pip-check
#
found=`find . \( -d 3 -a -path *bin/pip-check -o -d 4 -a -path *tox/*/bin/pip-check \)`
for pip_check in $found; do
echo "$ ${pip_check}"
$pip_check
done
if [ -z "$found" ]; then
echo "Fallback to global pip-check"
pip-check
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment