Skip to content

Commit 8a43e26

Browse files
committed
Drop 2.7
1 parent bb07253 commit 8a43e26

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ cache:
77
- $HOME/.cache/pip
88
python:
99
- 3.6
10-
- 2.7
1110

1211
sudo: required
1312

setup.py

+24-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,29 @@
1818

1919
name = "notebook"
2020

21-
# Minimal Python version sanity check
22-
v = sys.version_info
23-
if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
24-
error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
21+
if sys.version_info < (3, 5):
22+
pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
23+
try:
24+
import pip
25+
pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
26+
if pip_version < (9, 0, 1) :
27+
pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
28+
'pip {} detected.'.format(pip.__version__)
29+
else:
30+
# pip is new enough - it must be something else
31+
pip_message = ''
32+
except Exception:
33+
pass
34+
35+
36+
error = """
37+
Notebook 6.0+ supports Python 3.4 and above.
38+
When using Python 2.7, please install Notebook 5.x.
39+
40+
Python {py} detected.
41+
{pip}
42+
""".format(py=sys.version_info, pip=pip_message )
43+
2544
print(error, file=sys.stderr)
2645
sys.exit(1)
2746

@@ -100,6 +119,7 @@
100119
'nbval', 'nose-exclude', 'selenium'],
101120
'test:sys_platform == "win32"': ['nose-exclude'],
102121
},
122+
python_requires = '>=3.4',
103123
entry_points = {
104124
'console_scripts': [
105125
'jupyter-notebook = notebook.notebookapp:main',

0 commit comments

Comments
 (0)