diff --git a/.travis.yml b/.travis.yml index b5b35b6..552d79e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,36 @@ language: python sudo: false -python: - - "2.7" - - "3.5" - - "3.6" -env: - - NB_VERSION=4 - - NB_VERSION=5 - - FLAKE8=true NB_VERSION=5 - - NOTEST=true NB_VERSION=5 +jobs: + include: + - name: "Python 2.7 - Notebook 5 Tests" + python: "2.7" + env: + - TOXENV=py27-notebook5 + - name: "Python 3.5 - Notebook 5 Tests" + python: "3.5" + env: + - TOXENV=py35-notebook5 + - name: "Python 3.6 - Notebook 5 Tests" + python: "3.6" + env: + - TOXENV=py36-notebook5 + - name: "Python 3.5 - Notebook 6 Tests" + python: "3.5" + env: + - TOXENV=py35-notebook6 + - name: "Python 3.6 - Notebook 6 Tests" + python: "3.6" + env: + - TOXENV=py36-notebook6 + - name: "Check [tests] deps not required" + python: "3.5" + env: + - TOXENV=notest + - name: "Flake8" + python: "3.5" + env: + - TOXENV=flake8 services: - postgresql @@ -21,11 +42,7 @@ install: - pip install tox script: - - if [[ $TRAVIS_PYTHON_VERSION = '2.7' ]]; then tox -e py27-notebook$NB_VERSION; fi - - if [[ $TRAVIS_PYTHON_VERSION = '3.5' ]]; then tox -e py35-notebook$NB_VERSION; fi - - if [[ $TRAVIS_PYTHON_VERSION = '3.6' ]]; then tox -e py36-notebook$NB_VERSION; fi - - if [[ $FLAKE8 = 'true' ]]; then tox -e notest; fi - - if [[ $NOTEST = 'true' ]]; then tox -e flake8; fi + - tox branches: only: diff --git a/README.rst b/README.rst index 6aeab73..d6cfa80 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ Getting Started --------------- **Prerequisites:** - Write access to an empty `PostgreSQL `_ database. - - A Python installation with `Jupyter Notebook `_ >= 4.0. + - A Python installation with `Jupyter Notebook `_ >= 5.0. **Installation:** diff --git a/notebook4_constraints.txt b/notebook4_constraints.txt deleted file mode 100644 index 735927d..0000000 --- a/notebook4_constraints.txt +++ /dev/null @@ -1,2 +0,0 @@ -notebook<5 -tornado<5 diff --git a/notebook5_constraints.txt b/notebook5_constraints.txt index cff0ffd..e748a45 100644 --- a/notebook5_constraints.txt +++ b/notebook5_constraints.txt @@ -1 +1,73 @@ -notebook<6 +alembic==1.3.2 +attrs==19.3.0 +backports-abc==0.5 +backports.shutil-get-terminal-size==1.0.0 +bleach==3.1.0 +certifi==2019.11.28 +cffi==1.13.2 +chardet==3.0.4 +Click==7.0 +configparser==4.0.2 +contextlib2==0.6.0.post1 +cryptography==2.8 +decorator==4.4.1 +defusedxml==0.6.0 +entrypoints==0.3 +enum34==1.1.6 +flake8==3.7.9 +funcsigs==1.0.2 +functools32==3.2.3.post2 +futures==3.3.0 +idna==2.8 +importlib-metadata==1.3.0 +ipaddress==1.0.23 +ipykernel==4.10.1 +ipython==5.8.0 +ipython-genutils==0.2.0 +Jinja2==2.10.3 +jsonschema==3.2.0 +jupyter-client==5.3.4 +jupyter-core==4.6.1 +Mako==1.1.0 +MarkupSafe==1.1.1 +mccabe==0.6.1 +mistune==0.8.4 +mock==3.0.5 +more-itertools==5.0.0 +nbconvert==5.6.1 +nbformat==4.4.0 +nose==1.3.7 +nose-ignore-docstring==0.2 +notebook==5.7.8 +pandocfilters==1.4.2 +pathlib2==2.3.5 +pexpect==4.7.0 +pickleshare==0.7.5 +prometheus-client==0.7.1 +prompt-toolkit==1.0.18 +psycopg2==2.8.4 +ptyprocess==0.6.0 +pycodestyle==2.5.0 +pycparser==2.19 +pyflakes==2.1.1 +Pygments==2.5.2 +pyrsistent==0.15.6 +python-dateutil==2.8.1 +python-editor==1.0.4 +pyzmq==18.1.1 +requests==2.22.0 +scandir==1.10.0 +Send2Trash==1.5.0 +simplegeneric==0.8.1 +singledispatch==3.4.0.3 +six==1.13.0 +SQLAlchemy==1.3.12 +terminado==0.8.3 +testpath==0.4.4 +tornado==5.1.1 +traitlets==4.3.3 +typing==3.7.4.1 +urllib3==1.25.7 +wcwidth==0.1.7 +webencodings==0.5.1 +zipp==0.6.0 diff --git a/notebook6_constraints.txt b/notebook6_constraints.txt new file mode 100644 index 0000000..6120539 --- /dev/null +++ b/notebook6_constraints.txt @@ -0,0 +1,62 @@ +alembic==1.3.2 +attrs==19.3.0 +backcall==0.1.0 +bleach==3.1.0 +certifi==2019.11.28 +cffi==1.13.2 +chardet==3.0.4 +Click==7.0 +cryptography==2.8 +decorator==4.4.1 +defusedxml==0.6.0 +entrypoints==0.3 +flake8==3.7.9 +idna==2.8 +importlib-metadata==1.3.0 +ipykernel==5.1.3 +ipython==7.9.0 +ipython-genutils==0.2.0 +jedi==0.15.2 +Jinja2==2.10.3 +jsonschema==3.2.0 +jupyter-client==5.3.4 +jupyter-core==4.6.1 +Mako==1.1.0 +MarkupSafe==1.1.1 +mccabe==0.6.1 +mistune==0.8.4 +mock==3.0.5 +more-itertools==8.0.2 +nbconvert==5.6.1 +nbformat==4.4.0 +nose==1.3.7 +nose-ignore-docstring==0.2 +notebook==6.0.2 +pandocfilters==1.4.2 +parso==0.5.2 +pexpect==4.7.0 +pickleshare==0.7.5 +prometheus-client==0.7.1 +prompt-toolkit==2.0.10 +psycopg2==2.8.4 +ptyprocess==0.6.0 +pycodestyle==2.5.0 +pycparser==2.19 +pyflakes==2.1.1 +Pygments==2.5.2 +pyrsistent==0.15.6 +python-dateutil==2.8.1 +python-editor==1.0.4 +pyzmq==18.1.1 +requests==2.22.0 +Send2Trash==1.5.0 +six==1.13.0 +SQLAlchemy==1.3.12 +terminado==0.8.3 +testpath==0.4.4 +tornado==6.0.3 +traitlets==4.3.3 +urllib3==1.25.7 +wcwidth==0.1.7 +webencodings==0.5.1 +zipp==0.6.0 diff --git a/pgcontents/tests/test_hybrid_manager.py b/pgcontents/tests/test_hybrid_manager.py index 151b53a..6f1f3df 100644 --- a/pgcontents/tests/test_hybrid_manager.py +++ b/pgcontents/tests/test_hybrid_manager.py @@ -11,13 +11,15 @@ join as osjoin, ) from posixpath import join as pjoin +from unittest import TestCase from six import ( iteritems, itervalues, ) -from unittest import TestCase from IPython.utils.tempdir import TemporaryDirectory +from notebook.services.contents.tests.test_manager import TestContentsManager +from notebook.services.contents.tests.test_contents_api import APITest from pgcontents.hybridmanager import HybridContentsManager from pgcontents.pgmanager import PostgresContentsManager @@ -29,7 +31,7 @@ remigrate_test_schema, TEST_DB_URL, ) -from ..utils.ipycompat import APITest, FileContentsManager, TestContentsManager +from ..utils.ipycompat import FileContentsManager setup_module = remigrate_test_schema diff --git a/pgcontents/tests/test_pgcontents_api.py b/pgcontents/tests/test_pgcontents_api.py index c0ea245..92fd3d5 100644 --- a/pgcontents/tests/test_pgcontents_api.py +++ b/pgcontents/tests/test_pgcontents_api.py @@ -24,6 +24,8 @@ from six import iteritems from IPython.utils.tempdir import TemporaryDirectory +from notebook.services.contents.tests.test_contents_api import APITest +from notebook.tests.launchnotebook import assert_http_error from requests import HTTPError from ..constants import UNLIMITED @@ -50,8 +52,11 @@ TEST_DB_URL, ) from ..utils.ipycompat import ( - APITest, Config, FileContentsManager, GenericFileCheckpoints, to_os_path, - assert_http_error) + Config, + FileContentsManager, + GenericFileCheckpoints, + to_os_path, +) from ..utils.sync import walk, walk_dirs diff --git a/pgcontents/tests/test_pgmanager.py b/pgcontents/tests/test_pgmanager.py index bc1f42b..55ffb0f 100644 --- a/pgcontents/tests/test_pgmanager.py +++ b/pgcontents/tests/test_pgmanager.py @@ -21,6 +21,8 @@ from cryptography.fernet import Fernet from itertools import combinations +from notebook.services.contents.tests.test_manager import TestContentsManager + from pgcontents.pgmanager import PostgresContentsManager from .utils import ( assertRaisesHTTPError, @@ -31,7 +33,6 @@ remigrate_test_schema, ) from ..crypto import FernetEncryption -from ..utils.ipycompat import TestContentsManager from ..utils.sync import walk_files_with_content setup_module = remigrate_test_schema diff --git a/pgcontents/utils/ipycompat.py b/pgcontents/utils/ipycompat.py index d090507..5f84939 100644 --- a/pgcontents/utils/ipycompat.py +++ b/pgcontents/utils/ipycompat.py @@ -1,10 +1,6 @@ """ Utilities for managing compat between notebook versions. """ -import notebook -if notebook.version_info[0] >= 6: # noqa - raise ImportError("Jupyter Notebook versions 6 and up are not supported.") - from traitlets.config import Config from notebook.services.contents.checkpoints import ( Checkpoints, @@ -15,13 +11,6 @@ GenericFileCheckpoints ) from notebook.services.contents.manager import ContentsManager -from notebook.services.contents.tests.test_manager import ( - TestContentsManager -) -from notebook.services.contents.tests.test_contents_api import ( - APITest -) -from notebook.tests.launchnotebook import assert_http_error from notebook.utils import to_os_path from nbformat import from_dict, reads, writes from nbformat.v4.nbbase import ( @@ -43,9 +32,7 @@ __all__ = [ - 'APITest', 'Any', - 'assert_http_error', 'Bool', 'Checkpoints', 'Config', @@ -57,7 +44,6 @@ 'HasTraits', 'Instance', 'Integer', - 'TestContentsManager', 'Unicode', 'from_dict', 'new_code_cell', diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 703fa7c..0000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -SQLAlchemy>=1.0.5 -alembic>=0.7.6 -click>=3.3 -cryptography>=1.4 -psycopg2>=2.6.1 -requests>=2.7.0 -six>=1.9.0 -notebook[test]>=4.0,<6 diff --git a/requirements_test.txt b/requirements_test.txt deleted file mode 100644 index b2c20e2..0000000 --- a/requirements_test.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Test reqs. -tox -nose==1.3.4 -python-dateutil==2.4.2 -nose-ignore-docstring==0.2 -pyflakes==0.9.2 -pep8==1.6.2 -mccabe==0.3.1 -flake8==2.2.5 -mock==2.0.0 diff --git a/setup.py b/setup.py index 0b7fb52..0f86045 100644 --- a/setup.py +++ b/setup.py @@ -18,9 +18,6 @@ def read_requirements(basename): def main(): - reqs = read_requirements('requirements.txt') - test_reqs = read_requirements('requirements_test.txt') - setup( name='pgcontents', version='0.6', @@ -45,9 +42,23 @@ def main(): 'Programming Language :: Python', 'Topic :: Database', ], - install_requires=reqs, + install_requires=[ + 'SQLAlchemy>=1.0.5', + 'alembic>=0.7.6', + 'click>=3.3', + 'cryptography>=1.4', + 'psycopg2>=2.6.1', + 'six>=1.9.0', + 'notebook>=5.0', + ], extras_require={ - 'test': test_reqs, + 'test': [ + 'notebook[test]', + 'nose', + 'nose-ignore-docstring', + 'requests', + 'mock', + ], }, scripts=[ 'bin/pgcontents', diff --git a/tox.ini b/tox.ini index d17718a..84b45a5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py{27,35}-notebook4,py{27,35,36}-notebook5,flake8,notest +envlist=py{27,35,36}-notebook5,py{35,36}-notebook6,notest,flake8 skip_missing_interpreters=True [testenv] @@ -7,17 +7,17 @@ whitelist_externals = createdb install_command = - py{27,35,36}-notebook4: pip install -c notebook4_constraints.txt {opts} {packages} py{27,35,36}-notebook5: pip install -c notebook5_constraints.txt {opts} {packages} - flake8,notest: pip install {opts} {packages} + py{35,36}-notebook6: pip install -c notebook6_constraints.txt {opts} {packages} + notest,flake8: pip install {opts} {packages} deps = - py{27,35,36}-notebook{4,5}: .[test] + py{27,35,36}-notebook{5,6}: .[test] flake8: flake8 notest: . commands = - py{27,35,36}-notebook{4,5}: -createdb pgcontents_testing - py{27,35,36}-notebook{4,5}: nosetests pgcontents/tests + py{27,35,36}-notebook{5,6}: -createdb pgcontents_testing + py{27,35,36}-notebook{5,6}: nosetests pgcontents/tests flake8: flake8 pgcontents - notest: python -c 'from pgcontents.utils.ipycompat import *' + notest: python -c 'import pgcontents'