Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require ipykernel<6 #449

Merged
merged 12 commits into from
Sep 7, 2021
Merged

Require ipykernel<6 #449

merged 12 commits into from
Sep 7, 2021

Conversation

mdickinson
Copy link
Member

Envisage doesn't currently work with ipykernel 6.0 and later, and it looks as though substantial effort is required to make it work; see #448.

In the meantime, we should make sure that a pip install envisage[ipython] avoids ipykernel version 6 and later.

@mdickinson
Copy link
Member Author

This should really have a test, in the form of a GitHub Actions workflow that runs the test suite after a pip install .[ipython].

Right now, even after that pip install, IPython-related tests are still skipped, because ipykernel depends on ipython_genutils but doesn't declare that dependence.

@mdickinson
Copy link
Member Author

mdickinson commented Sep 1, 2021

because ipykernel depends on ipython_genutils but doesn't declare that dependence.

Hmm. The PyPI page for ipython_genutils says I'm supposed to pretend it doesn't exist. That's a bit awkward here.

What seems to be happening:

  • ipykernel < 6, >= 4 requires ipython_genutils to function, but doesn't declare that dependence
  • ipykernel also requires traitlets
  • traitlets < 5.1 requires ipython_genutils, and does declare that dependence
  • traitlets >= 5.1 (released two days ago) no longer requires ipython_genutils

The result is that as of right now, if you do a pip install 'ipykernel<6' into a clean venv and then try to import ipykernel, that import fails:

mdickinson@mirzakhani Desktop % python -m venv --clear testing && source testing/bin/activate
(testing) mdickinson@mirzakhani Desktop % pip install 'ipykernel<6'
Collecting ipykernel<6
  Using cached ipykernel-5.5.5-py3-none-any.whl (120 kB)
Collecting ipython>=5.0.0
  Using cached ipython-7.27.0-py3-none-any.whl (787 kB)
Collecting appnope
  Using cached appnope-0.1.2-py2.py3-none-any.whl (4.3 kB)
Collecting traitlets>=4.1.0
  Using cached traitlets-5.1.0-py3-none-any.whl (101 kB)
Collecting jupyter-client
  Using cached jupyter_client-7.0.2-py3-none-any.whl (122 kB)
Collecting tornado>=4.2
  Using cached tornado-6.1-cp39-cp39-macosx_10_9_x86_64.whl (416 kB)
Collecting pexpect>4.3
  Using cached pexpect-4.8.0-py2.py3-none-any.whl (59 kB)
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
  Using cached prompt_toolkit-3.0.20-py3-none-any.whl (370 kB)
Collecting pygments
  Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting pickleshare
  Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting backcall
  Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting matplotlib-inline
  Using cached matplotlib_inline-0.1.2-py3-none-any.whl (8.2 kB)
Requirement already satisfied: setuptools>=18.5 in ./testing/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel<6) (57.4.0)
Collecting decorator
  Using cached decorator-5.0.9-py3-none-any.whl (8.9 kB)
Collecting jedi>=0.16
  Using cached jedi-0.18.0-py2.py3-none-any.whl (1.4 MB)
Collecting parso<0.9.0,>=0.8.0
  Using cached parso-0.8.2-py2.py3-none-any.whl (94 kB)
Collecting ptyprocess>=0.5
  Using cached ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Collecting wcwidth
  Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting pyzmq>=13
  Using cached pyzmq-22.2.1-cp39-cp39-macosx_10_15_universal2.whl (2.0 MB)
Collecting nest-asyncio>=1.5
  Using cached nest_asyncio-1.5.1-py3-none-any.whl (5.0 kB)
Collecting entrypoints
  Using cached entrypoints-0.3-py2.py3-none-any.whl (11 kB)
Collecting python-dateutil>=2.1
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting jupyter-core>=4.6.0
  Using cached jupyter_core-4.7.1-py3-none-any.whl (82 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: wcwidth, traitlets, six, ptyprocess, parso, tornado, pyzmq, python-dateutil, pygments, prompt-toolkit, pickleshare, pexpect, nest-asyncio, matplotlib-inline, jupyter-core, jedi, entrypoints, decorator, backcall, appnope, jupyter-client, ipython, ipykernel
Successfully installed appnope-0.1.2 backcall-0.2.0 decorator-5.0.9 entrypoints-0.3 ipykernel-5.5.5 ipython-7.27.0 jedi-0.18.0 jupyter-client-7.0.2 jupyter-core-4.7.1 matplotlib-inline-0.1.2 nest-asyncio-1.5.1 parso-0.8.2 pexpect-4.8.0 pickleshare-0.7.5 prompt-toolkit-3.0.20 ptyprocess-0.7.0 pygments-2.10.0 python-dateutil-2.8.2 pyzmq-22.2.1 six-1.16.0 tornado-6.1 traitlets-5.1.0 wcwidth-0.2.5
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the '/Users/mdickinson/Desktop/testing/bin/python -m pip install --upgrade pip' command.
(testing) mdickinson@mirzakhani Desktop % python -c "import ipykernel"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/mdickinson/Desktop/testing/lib/python3.9/site-packages/ipykernel/__init__.py", line 2, in <module>
    from .connect import *
  File "/Users/mdickinson/Desktop/testing/lib/python3.9/site-packages/ipykernel/connect.py", line 13, in <module>
    from ipython_genutils.path import filefind
ModuleNotFoundError: No module named 'ipython_genutils'

Given that we're supposed to pretend that ipython_genutils doesn't exist, it looks as though the right thing to do may be to restrict the version of traitlets we're using to a version that still requires ipython_genutils.

@mdickinson
Copy link
Member Author

I opened an upstream issue for the ipython_genutils problem: ipython/ipykernel#759

@mdickinson
Copy link
Member Author

For cleanliness, I've extracted the new workflow into its own PR: #450.

@mdickinson mdickinson merged commit caede53 into main Sep 7, 2021
@mdickinson mdickinson deleted the fix/require-ipykernel-older-than-6 branch September 7, 2021 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants