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

Release jupyter_kernel_mgmt 0.5.0 #33

Closed
echarles opened this issue Nov 9, 2019 · 32 comments
Closed

Release jupyter_kernel_mgmt 0.5.0 #33

echarles opened this issue Nov 9, 2019 · 32 comments

Comments

@echarles
Copy link
Contributor

echarles commented Nov 9, 2019

This issue is created to track the release jupyter_kernel_mgmt 0.5.0.

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

@takluyver @kevin-bates We will start tomorrow during the jupyterlab dev meeting to pepare the release of jupyter server. This depends on a released jupyter_kernel_mgmt.

What are we still missing to get a 0.5.0 release?

@kevin-bates
Copy link
Collaborator

I think we're ready to cut 0.5.0. @takluyver - if you agree, is this something you have bandwidth to do, or do you want me to push things through?

@takluyver
Copy link
Owner

If you have the bandwidth, go for it. I may be able to get to it if you can't, but I'm not going to be upset if you get there first. 😉

I've just pushed some docs changes I did earlier but failed to push at the time.

@kevin-bates
Copy link
Collaborator

Hmm - @takluyver I'm getting errors building the docs. The errors are relative to the high-level api rework and generate this page: https://jupyter-kernel-mgmt.readthedocs.io/en/latest/api/hl.html

This is an 0.5 blocker.

Here are the errors produced from make html in the docs directory...

WARNING: autodoc: failed to import class 'run_kernel_async' from module 'jupyter_kernel_mgmt'; the following exception was raised:
Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 243, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'jupyter_kernel_mgmt' has no attribute 'run_kernel_async'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 75, in import_object
    obj = attrgetter(obj, attrname)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 235, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 1569, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 259, in safe_getattr
    raise AttributeError(name)
AttributeError: run_kernel_async

WARNING: autodoc: failed to import function 'start_kernel_async' from module 'jupyter_kernel_mgmt'; the following exception was raised:
Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 243, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'jupyter_kernel_mgmt' has no attribute 'start_kernel_async'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 75, in import_object
    obj = attrgetter(obj, attrname)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 235, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 1569, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 259, in safe_getattr
    raise AttributeError(name)
AttributeError: start_kernel_async

WARNING: autodoc: failed to import function 'run_kernel_blocking' from module 'jupyter_kernel_mgmt'; the following exception was raised:
Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 243, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'jupyter_kernel_mgmt' has no attribute 'run_kernel_blocking'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 75, in import_object
    obj = attrgetter(obj, attrname)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 235, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 1569, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 259, in safe_getattr
    raise AttributeError(name)
AttributeError: run_kernel_blocking

WARNING: autodoc: failed to import function 'start_kernel_blocking' from module 'jupyter_kernel_mgmt'; the following exception was raised:
Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 243, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'jupyter_kernel_mgmt' has no attribute 'start_kernel_blocking'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 75, in import_object
    obj = attrgetter(obj, attrname)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 235, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 1569, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/opt/anaconda3/envs/kernel-mgmt-dev/lib/python3.6/site-packages/sphinx/util/inspect.py", line 259, in safe_getattr
    raise AttributeError(name)
AttributeError: start_kernel_blocking

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

@kevin-bates I think the issue does not come from @takluyver last commit but from the changes I have brought to the conda env. To generate the API doc, sphinx needs to get the code it inspects installed. There were some rest of jupyter_client so I added it in the conda file but did not test, and of course, jupyter_client is not in conda repos. so the conda env was not created.

Let me open a new PR to fix this.

Side question, I think the published docs does not contain the API details. Even with a fix for this, I believe the API will not be created. Let's see...

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

Should the readthedoc.io be configured so it first pip install -e . before generating the html?

@takluyver
Copy link
Owner

I've just pushed commit 86bb83c which should ensure the development version of JKM is installed on RTD before building.

For building locally, you need to ensure the development version is importable, either by installing it in the same environment as Sphinx runs, or adding it to sys.path by uncommenting this line and changing . to ...

@takluyver
Copy link
Owner

No, still not quite working. Something is importing jupyter_client; I'm trying to work out what.

@kevin-bates
Copy link
Collaborator

Doh! Thanks to both of you. (I forgot about installing the dev version prior to build - sorry about that.) The high-level API page looks good.

Hmm - @takluyver - just saw your update. The docs build, but I see refs to jc in two test files and docs/conf.py...

./jupyter_kernel_mgmt/tests/test_kernelapp.py:15:                  'from jupyter_client.kernelapp import main; main()'],
./jupyter_kernel_mgmt/tests/test_kernelspec.py:159:        [sys.executable, '-m', 'jupyter_client.kernelspecapp', 'remove', 'sample', '-f'],
./jupyter_kernel_mgmt/tests/utils.py:1:"""Testing utils for jupyter_client tests
./docs/conf.py:298:                       'jupyter_client': ('http://jupyter-client.readthedocs.io/en/stable/', None)}

@takluyver
Copy link
Owner

The build succeeds, but the autodoc part is not working at the moment.

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

yep. I searched for jupyter_client and it was in the python comments, not in the source if I remember well. This is why I added it (badly) to the env.

Right now none of the API pages are populated. They are created but not populated. At the single warning, I believe the autodoc are not run.

To get it working on my local env, I had to install jupyter_client.

@takluyver
Copy link
Owner

Installing jupyter_client should fix it. But it shouldn't require that, so I'm trying to understand why it does.

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

I think we have to update the conda env with

pip 
pip
  jupyter_client

Then it wiill work

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

True. I spent time also to understand why it needed jupyter_client. I think sphynx is clever and see we are referring to it (even without importing it).

@takluyver
Copy link
Owner

Sphinx is clever in many ways, but I don't think that's one of them 😉

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

@takluyver
Copy link
Owner

The link there is an intersphinx thing, it doesn't require importing the Python module.

The imports are a leftover dependency in the released version of jupyter_protocol, which has already been fixed but not yet released:

$ python3 -c "import jupyter_kernel_mgmt.client_base"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/takluyver/Code/jupyter_kernel_mgmt/jupyter_kernel_mgmt/__init__.py", line 4, in <module>
    from .hl import (
  File "/home/takluyver/Code/jupyter_kernel_mgmt/jupyter_kernel_mgmt/hl.py", line 3, in <module>
    from .client import IOLoopKernelClient, BlockingKernelClient
  File "/home/takluyver/Code/jupyter_kernel_mgmt/jupyter_kernel_mgmt/client.py", line 26, in <module>
    from .client_base import KernelClient
  File "/home/takluyver/Code/jupyter_kernel_mgmt/jupyter_kernel_mgmt/client_base.py", line 16, in <module>
    from jupyter_protocol.sockets import ClientMessaging
  File "/home/takluyver/miniconda3/envs/jk_mgmt_docs/lib/python3.7/site-packages/jupyter_protocol/sockets.py", line 5, in <module>
    from .session import Session
  File "/home/takluyver/miniconda3/envs/jk_mgmt_docs/lib/python3.7/site-packages/jupyter_protocol/session.py", line 17, in <module>
    from jupyter_client.jsonutil import extract_dates, date_default
ModuleNotFoundError: No module named 'jupyter_client'

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

BTW to release JKM, we should first release JKP

@takluyver
Copy link
Owner

OK, the autodoc sections now work correctly: https://jupyter-kernel-mgmt.readthedocs.io/en/latest/api/hl.html

Once we have released jupyter_protocol again, we should be able to remove jupyter_client from the docs/environment.yml file again.

@kevin-bates
Copy link
Collaborator

Thanks guys. My docs built fine sans jc in env.yml, but I definitely had the dev version of jupyter_protocol in my env.

Can we get JP released? I will then release 0.5 (including the removal of jc in environment.yml).

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

Makes sense to first release JP if possible. Then update setup.py and conda env.

jc is like https://i.pinimg.com/originals/aa/3d/fb/aa3dfb7a15b817572b1f5a00d7621975.jpg

@takluyver
Copy link
Owner

I've released jupyter_protocol 0.2, and removed jupyter_client from environment.yml in this repository again. The new doc build seems to be OK (no warnings):

https://readthedocs.org/projects/jupyter-kernel-mgmt/builds/10048031/

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

Awesome Thomas! Thx a lot. Really exciting to get this released.

@kevin-bates
Copy link
Collaborator

Yes - thank you very much! I'll take a crack at 0.5.0 right now.

@kevin-bates
Copy link
Collaborator

0.5.0 has been released!

https://pypi.org/project/jupyter-kernel-mgmt

@echarles
Copy link
Contributor Author

echarles commented Dec 1, 2019

Thx Kevin. Congrats to you and Thomas for all the great work.

@kevin-bates
Copy link
Collaborator

@takluyver - Sigh - of course this is discovered after the release! This is from the jupyter_server build and only occurs on python 3.5. If we're going to support 3.5, I think we should add it to the build matrix. IIRC, you mentioned 3.5 would not be supported as of this month - correct? I'm kinda inclined to move jupyter_server > 3.5 actually.

======================================================================
ERROR: Failure: SyntaxError (invalid syntax (hl.py, line 51))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 697, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/travis/build/jupyter/jupyter_server/jupyter_server/services/api/tests/test_api.py", line 7, in <module>
    from jupyter_server.tests.launchserver import ServerTestBase
  File "/home/travis/build/jupyter/jupyter_server/jupyter_server/tests/launchserver.py", line 24, in <module>
    from jupyter_kernel_mgmt.discovery import KernelSpecProvider, IPykernelProvider
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/jupyter_kernel_mgmt/__init__.py", line 4, in <module>
    from .hl import (
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/jupyter_kernel_mgmt/hl.py", line 51
    ):
    ^
SyntaxError: invalid syntax

@echarles
Copy link
Contributor Author

echarles commented Dec 2, 2019

3.5 is theoretically still alive until 2020-09-13 https://devguide.python.org/#status-of-python-branches

But in practice it seems like all latest standard platforms don't use it anymore python-trio/trio#75 (comment)

I am also in favor of python > 3.5

@takluyver
Copy link
Owner

Maybe we were a bit overeager in removing 3.5 from CI on this repo. 😉 I'm puzzled why it fails on that line, though:

def start_kernel_blocking(
name, *, cwd=None, launch_params=None, finder=None, startup_timeout=60,
):

Keyword-only arguments are valid since Python 3.0, I thought. 😕

If you prefer to figure out the fix to make it work with 3.5, I'm happy enough. Otherwise, NEP 29 recommends that 3.5 can already be dropped, so I wouldn't spend too much effort on it.

@echarles
Copy link
Contributor Author

echarles commented Dec 2, 2019

I have opened jupyter-server/jupyter_server#142 in jupyter_server to enforce 3.6. If this gets merged, we can leave it as it is.

@kevin-bates
Copy link
Collaborator

The syntax error on 3.5 is due to the trailing comma on the function declaration: https://github.com/takluyver/jupyter_kernel_mgmt/blob/master/jupyter_kernel_mgmt/hl.py#L49-L51

I'm fine dropping 3.5 as well and I don't think it's removal warrants another release at this time.

@takluyver
Copy link
Owner

Huh, I didn't know that was new. It seems like we're all in agreement to drop 3.5 support anyway, but it's good to know what the issue is in case we do need to revisit that.

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

No branches or pull requests

3 participants