Skip to content

Commit 7817ff4

Browse files
author
Scott Sanderson
committed
MAINT: Drop IPython 3 support.
1 parent 679faaa commit 7817ff4

File tree

7 files changed

+60
-102
lines changed

7 files changed

+60
-102
lines changed

.travis.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ sudo: false
33

44
matrix:
55
include:
6-
- python: 2.7
7-
env: NB_VERSION=ipython3
86
- python: 2.7
97
env: NB_VERSION=notebook4
108
- python: 2.7
119
env: NB_VERSION=notebook5
1210

13-
- python: 3.4
14-
env: NB_VERSION=ipython3
1511
- python: 3.4
1612
env: NB_VERSION=notebook4
1713
- python: 3.4
@@ -22,16 +18,21 @@ matrix:
2218
- python: 3.6
2319
env: NB_VERSION=notebook5
2420

21+
- env: FLAKE8=true
22+
- env: NOTEST=true
23+
2524
addons:
2625
postgresql: "9.3"
2726

2827
install:
2928
- pip install tox
3029

3130
script:
32-
- if [[ $TRAVIS_PYTHON_VERSION = '2.7' ]]; then tox -e py27-$NB_VERSION,flake8; fi
33-
- if [[ $TRAVIS_PYTHON_VERSION = '3.4' ]]; then tox -e py34-$NB_VERSION,flake8; fi
34-
- if [[ $TRAVIS_PYTHON_VERSION = '3.6' ]]; then tox -e py36-$NB_VERSION; fi
31+
- if [[ $TRAVIS_PYTHON_VERSION = '2.7' ]]; then tox -e py27-notebook$NB_VERSION; fi
32+
- if [[ $TRAVIS_PYTHON_VERSION = '3.4' ]]; then tox -e py34-notebook$NB_VERSION; fi
33+
- if [[ $TRAVIS_PYTHON_VERSION = '3.6' ]]; then tox -e py36-notebook$NB_VERSION; fi
34+
- if [[ $FLAKE8 = 'true' ]]; then tox -e notest; fi
35+
- if [[ $NOTEST = 'true' ]]; then tox -e flake8; fi
3536

3637
branches:
3738
only:

notebook4_constraints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
notebook<5
2+
tornado<5

notebook5_constraints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
notebook<6

pgcontents/utils/ipycompat.py

Lines changed: 39 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,46 @@
11
"""
2-
Utilities for managing IPython 3/4 compat.
2+
Utilities for managing compat between notebook versions.
33
"""
4-
import IPython
4+
import notebook
5+
if notebook.version_info[0] >= 6: # noqa
6+
raise ImportError("Jupyter Notebook versions 6 and up are not supported.")
57

6-
IPY_MAJOR = IPython.version_info[0]
7-
if IPY_MAJOR < 3:
8-
raise ImportError("IPython version %d is not supported." % IPY_MAJOR)
8+
from traitlets.config import Config
9+
from notebook.services.contents.checkpoints import (
10+
Checkpoints,
11+
GenericCheckpointsMixin,
12+
)
13+
from notebook.services.contents.filemanager import FileContentsManager
14+
from notebook.services.contents.filecheckpoints import (
15+
GenericFileCheckpoints
16+
)
17+
from notebook.services.contents.manager import ContentsManager
18+
from notebook.services.contents.tests.test_manager import (
19+
TestContentsManager
20+
)
21+
from notebook.services.contents.tests.test_contents_api import (
22+
APITest
23+
)
24+
from notebook.tests.launchnotebook import assert_http_error
25+
from notebook.utils import to_os_path
26+
from nbformat import from_dict, reads, writes
27+
from nbformat.v4.nbbase import (
28+
new_code_cell,
29+
new_markdown_cell,
30+
new_notebook,
31+
new_raw_cell,
32+
)
33+
from nbformat.v4.rwbase import strip_transient
34+
from traitlets import (
35+
Any,
36+
Bool,
37+
Dict,
38+
Instance,
39+
Integer,
40+
HasTraits,
41+
Unicode,
42+
)
943

10-
IPY3 = (IPY_MAJOR == 3)
11-
12-
if IPY3:
13-
from IPython.config import Config
14-
from IPython.html.services.contents.manager import ContentsManager
15-
from IPython.html.services.contents.checkpoints import (
16-
Checkpoints,
17-
GenericCheckpointsMixin,
18-
)
19-
from IPython.html.services.contents.filemanager import FileContentsManager
20-
from IPython.html.services.contents.filecheckpoints import (
21-
GenericFileCheckpoints
22-
)
23-
from IPython.html.services.contents.tests.test_manager import (
24-
TestContentsManager
25-
)
26-
from IPython.html.services.contents.tests.test_contents_api import (
27-
APITest
28-
)
29-
from IPython.html.tests.launchnotebook import assert_http_error
30-
from IPython.html.utils import to_os_path
31-
from IPython.nbformat import from_dict, reads, writes
32-
from IPython.nbformat.v4.nbbase import (
33-
new_code_cell,
34-
new_markdown_cell,
35-
new_notebook,
36-
new_raw_cell,
37-
)
38-
from IPython.nbformat.v4.rwbase import strip_transient
39-
from IPython.utils.traitlets import (
40-
Any,
41-
Bool,
42-
Dict,
43-
Instance,
44-
Integer,
45-
HasTraits,
46-
Unicode,
47-
)
48-
else:
49-
import notebook
50-
if notebook.version_info[0] >= 6:
51-
raise ImportError("Notebook versions 6 and up are not supported.")
52-
53-
from traitlets.config import Config
54-
from notebook.services.contents.checkpoints import (
55-
Checkpoints,
56-
GenericCheckpointsMixin,
57-
)
58-
from notebook.services.contents.filemanager import FileContentsManager
59-
from notebook.services.contents.filecheckpoints import (
60-
GenericFileCheckpoints
61-
)
62-
from notebook.services.contents.manager import ContentsManager
63-
from notebook.services.contents.tests.test_manager import (
64-
TestContentsManager
65-
)
66-
from notebook.services.contents.tests.test_contents_api import (
67-
APITest
68-
)
69-
from notebook.tests.launchnotebook import assert_http_error
70-
from notebook.utils import to_os_path
71-
from nbformat import from_dict, reads, writes
72-
from nbformat.v4.nbbase import (
73-
new_code_cell,
74-
new_markdown_cell,
75-
new_notebook,
76-
new_raw_cell,
77-
)
78-
from nbformat.v4.rwbase import strip_transient
79-
from traitlets import (
80-
Any,
81-
Bool,
82-
Dict,
83-
Instance,
84-
Integer,
85-
HasTraits,
86-
Unicode,
87-
)
8844

8945
__all__ = [
9046
'APITest',

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cryptography>=1.4
55
psycopg2>=2.6.1
66
requests>=2.7.0
77
six>=1.9.0
8-
tox>=2.3
8+
notebook[test]>=4.0

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def main():
3434
zip_safe=False,
3535
url="https://github.com/quantopian/pgcontents",
3636
classifiers=[
37-
'Development Status :: 4 - Beta'
37+
'Development Status :: 4 - Beta',
3838
'Framework :: IPython',
3939
'License :: OSI Approved :: Apache Software License',
4040
'Natural Language :: English',
@@ -47,9 +47,6 @@ def main():
4747
install_requires=reqs,
4848
extras_require={
4949
'test': test_reqs,
50-
'ipy3': ['ipython[test,notebook]<4.0', 'tornado<5.0'],
51-
'notebook4': ['notebook[test]>=4.0,<5.0', 'tornado<5.0'],
52-
'notebook5': ['notebook[test]>=5.0']
5350
},
5451
scripts=[
5552
'bin/pgcontents',

tox.ini

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
[tox]
2-
envlist=py{27,34}-ipython3,py{27,34,36}-notebook{4,5},flake8
2+
envlist=py{27,34}-notebook4,py{27,34,36}-notebook5,flake8,notest
33
skip_missing_interpreters=True
44

55
[testenv]
66
whitelist_externals =
77
createdb
88

9+
install_command =
10+
py{27,34,36}-notebook4: pip install -c notebook4_constraints.txt {opts} {packages}
11+
py{27,34,36}-notebook5: pip install -c notebook5_constraints.txt {opts} {packages}
12+
flake8,notest: pip install {opts} {packages}
13+
914
deps =
10-
py{27,34}-ipython3: .[test,ipy3]
11-
py{27,34,36}-notebook4: .[test,notebook4]
12-
py{27,34,36}-notebook5: .[test,notebook5]
15+
py{27,34,36}-notebook{4,5}: .[test]
1316
flake8: flake8
14-
notest: .[notebook5]
17+
notest: .
1518

1619
commands =
17-
py{27,34}-ipython3: -createdb pgcontents_testing
18-
py{27,34}-ipython3: nosetests pgcontents/tests
1920
py{27,34,36}-notebook{4,5}: -createdb pgcontents_testing
2021
py{27,34,36}-notebook{4,5}: nosetests pgcontents/tests
2122
flake8: flake8 pgcontents

0 commit comments

Comments
 (0)