From 6981ca84bffea1239a4ba03d695065e2011c8891 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 4 Jul 2019 13:55:41 +0100 Subject: [PATCH] Add setuptools minimum version trap --- library/setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/library/setup.py b/library/setup.py index aefc022..b21ce9d 100755 --- a/library/setup.py +++ b/library/setup.py @@ -22,9 +22,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from setuptools import setup +from setuptools import setup, __version__, version -setup( +minimum_version = version.pkg_resources.parse_version('30.4.0') + +if version.pkg_resources.parse_version(__version__) < minimum_version: + raise RuntimeError("Package setuptools must be at least version {}".format(minimum_version)) + +result = setup( packages=['enviroplus'], - install_requires=['pimoroni-bme280', 'pms5003', 'ltr559', 'st7735', 'ads1015'] + install_requires=['setuptools>='.format(minimum_version), 'pimoroni-bme280', 'pms5003', 'ltr559', 'st7735', 'ads1015'] ) -- 2.30.2