Skip to content

Commit 73dd091

Browse files
authored
Add setuptools check on install with clear message (#89)
1 parent e4f081a commit 73dd091

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

setup.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# coding: utf-8
2-
from setuptools import setup, find_packages
2+
from distutils.version import LooseVersion
3+
4+
from setuptools import find_packages, setup
5+
6+
7+
def check_setuptools():
8+
import pkg_resources
9+
st_version = pkg_resources.get_distribution('setuptools').version
10+
if LooseVersion(st_version) < LooseVersion('20.2.2'):
11+
exit('The Instana sensor requires a newer verion of `setuptools` (>=20.2.2).\n'
12+
'Please run `pip install --upgrade setuptools` to upgrade. \n'
13+
' and then try the install again.\n'
14+
'Also:\n'
15+
' `pip show setuptools` - shows the current version\n'
16+
' To see the setuptool releases: \n'
17+
' https://setuptools.readthedocs.io/en/latest/history.html')
18+
19+
20+
check_setuptools()
321

422
setup(name='instana',
523
version='0.11.0',

0 commit comments

Comments
 (0)