|
3 | 3 | from setuptools import setup
|
4 | 4 | import os
|
5 | 5 | import io
|
| 6 | +import sys |
| 7 | + |
| 8 | + |
| 9 | +CURRENT_PYTHON = sys.version_info[:2] |
| 10 | +REQUIRED_PYTHON = (3, 6) |
| 11 | + |
| 12 | +# This check and everything above must remain compatible with Python 2.7. |
| 13 | +if CURRENT_PYTHON < REQUIRED_PYTHON: |
| 14 | + sys.stderr.write(""" |
| 15 | +========================== |
| 16 | +Unsupported Python version |
| 17 | +========================== |
| 18 | +This version of metric-learn requires Python {}.{}, but you're trying to |
| 19 | +install it on Python {}.{}. |
| 20 | +This may be because you are using a version of pip that doesn't |
| 21 | +understand the python_requires classifier. Make sure you |
| 22 | +have pip >= 9.0 and setuptools >= 24.2, then try again: |
| 23 | + $ python -m pip install --upgrade pip setuptools |
| 24 | + $ python -m pip install django |
| 25 | +This will install the latest version of metric-learn which works on your |
| 26 | +version of Python. If you can't upgrade your pip (or Python), request |
| 27 | +an older version of metric-learn: |
| 28 | + $ python -m pip install "metric-learn<0.6.0" |
| 29 | +""".format(*(REQUIRED_PYTHON + CURRENT_PYTHON))) |
| 30 | + sys.exit(1) |
| 31 | + |
6 | 32 |
|
7 | 33 | version = {}
|
8 | 34 | with io.open(os.path.join('metric_learn', '_version.py')) as fp:
|
|
16 | 42 | version=version['__version__'],
|
17 | 43 | description='Python implementations of metric learning algorithms',
|
18 | 44 | long_description=long_description,
|
| 45 | + python_requires='>={}.{}'.format(*REQUIRED_PYTHON), |
19 | 46 | author=[
|
20 | 47 | 'CJ Carey',
|
21 | 48 | 'Yuan Tang',
|
|
38 | 65 | install_requires=[
|
39 | 66 | 'numpy',
|
40 | 67 | 'scipy',
|
41 |
| - 'scikit-learn', |
| 68 | + 'scikit-learn>=0.20.3', |
42 | 69 | ],
|
43 | 70 | extras_require=dict(
|
44 | 71 | docs=['sphinx', 'shinx_rtd_theme', 'numpydoc'],
|
|
0 commit comments