Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
431 B
Python
Raw Permalink Normal View History

#! /usr/bin/env python3
import pkg_resources
2020-07-30 12:05:49 -05:00
import sys
from pkg_resources import DistributionNotFound, VersionConflict
2020-05-06 17:58:17 +02:00
args = sys.argv
# verbose flag
2021-03-28 18:02:33 +02:00
verbose = "-v" in args
2020-05-06 17:58:17 +02:00
2021-03-28 18:02:33 +02:00
requirements = ["PyMySQL"]
2020-07-17 17:12:18 -05:00
try:
pkg_resources.require(requirements)
except DistributionNotFound as req:
if verbose:
print(req)
2020-07-30 12:05:49 -05:00
sys.exit(1)
2020-07-17 17:12:18 -05:00
except VersionConflict as req:
if verbose:
print(req)
2020-07-30 12:05:49 -05:00
sys.exit(2)
sys.exit(0)