From 2c766d7bf2d79e671b900671e673b1cecf007ac4 Mon Sep 17 00:00:00 2001 From: vrde Date: Thu, 12 May 2016 15:08:30 +0200 Subject: [PATCH] Display useful message when setuptools is outdated --- setup.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/setup.py b/setup.py index 3905799d..42ca96a3 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,28 @@ For full docs visit https://bigchaindb.readthedocs.org """ from setuptools import setup, find_packages + # get the version version = {} with open('bigchaindb/version.py') as fp: exec(fp.read(), version) + +# check if setuptools is up to date +def check_setuptools_features(): + import pkg_resources + try: + list(pkg_resources.parse_requirements('foo~=1.0')) + except pkg_resources.RequirementParseError: + exit('Your Python distribution comes with an incompatible version ' + 'of `setuptools`. Please run:\n' + ' $ pip install --update setuptools\n' + 'and then run this command again') + + +check_setuptools_features() + + tests_require = [ 'pytest', 'coverage',