Skip to content

Commit

Permalink
Drop 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Sep 16, 2018
1 parent bb07253 commit 8a43e26
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,6 @@ cache:
- $HOME/.cache/pip
python:
- 3.6
- 2.7

sudo: required

Expand Down
28 changes: 24 additions & 4 deletions setup.py
Expand Up @@ -18,10 +18,29 @@

name = "notebook"

# Minimal Python version sanity check
v = sys.version_info
if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
if sys.version_info < (3, 5):
pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
try:
import pip
pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
if pip_version < (9, 0, 1) :
pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
'pip {} detected.'.format(pip.__version__)
else:
# pip is new enough - it must be something else
pip_message = ''
except Exception:
pass


error = """
Notebook 6.0+ supports Python 3.4 and above.
When using Python 2.7, please install Notebook 5.x.
Python {py} detected.
{pip}
""".format(py=sys.version_info, pip=pip_message )

print(error, file=sys.stderr)
sys.exit(1)

Expand Down Expand Up @@ -100,6 +119,7 @@
'nbval', 'nose-exclude', 'selenium'],
'test:sys_platform == "win32"': ['nose-exclude'],
},
python_requires = '>=3.4',
entry_points = {
'console_scripts': [
'jupyter-notebook = notebook.notebookapp:main',
Expand Down

0 comments on commit 8a43e26

Please sign in to comment.