Skip to content

Commit d218d78

Browse files
authored
[MRG] Add python requires plus message for old pips (#299)
* Add python requires plus message for old pips * Update install requires for scikit-learn
1 parent 3e1af68 commit d218d78

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

metric_learn/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.6.0'
1+
__version__ = '0.6.1'

setup.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@
33
from setuptools import setup
44
import os
55
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+
632

733
version = {}
834
with io.open(os.path.join('metric_learn', '_version.py')) as fp:
@@ -16,6 +42,7 @@
1642
version=version['__version__'],
1743
description='Python implementations of metric learning algorithms',
1844
long_description=long_description,
45+
python_requires='>={}.{}'.format(*REQUIRED_PYTHON),
1946
author=[
2047
'CJ Carey',
2148
'Yuan Tang',
@@ -38,7 +65,7 @@
3865
install_requires=[
3966
'numpy',
4067
'scipy',
41-
'scikit-learn',
68+
'scikit-learn>=0.20.3',
4269
],
4370
extras_require=dict(
4471
docs=['sphinx', 'shinx_rtd_theme', 'numpydoc'],

0 commit comments

Comments
 (0)