| 1 |
# Jupyter Client |
| 2 |
|
| 3 |
[](https://github.com/jupyter/jupyter_client/actions) |
| 4 |
[](http://jupyter-client.readthedocs.io/en/latest/?badge=latest) |
| 5 |
|
| 6 |
`jupyter_client` contains the reference implementation of the [Jupyter protocol]. |
| 7 |
It also provides client and kernel management APIs for working with kernels. |
| 8 |
|
| 9 |
It also provides the `jupyter kernelspec` entrypoint |
| 10 |
for installing kernelspecs for use with Jupyter frontends. |
| 11 |
|
| 12 |
## Development Setup |
| 13 |
|
| 14 |
The [Jupyter Contributor Guides](https://jupyter.readthedocs.io/en/latest/contributing/content-contributor.html) provide extensive information on contributing code or documentation to Jupyter projects. The limited instructions below for setting up a development environment are for your convenience. |
| 15 |
|
| 16 |
## Coding |
| 17 |
|
| 18 |
You'll need Python and `pip` on the search path. Clone the Jupyter Client git repository to your computer, for example in `/my/project/jupyter_client` |
| 19 |
|
| 20 |
```bash |
| 21 |
cd /my/projects/ |
| 22 |
git clone [email protected]:jupyter/jupyter_client.git |
| 23 |
``` |
| 24 |
|
| 25 |
Now create an [editable install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs) |
| 26 |
and download the dependencies of code and test suite by executing: |
| 27 |
|
| 28 |
```bash |
| 29 |
cd /my/projects/jupyter_client/ |
| 30 |
pip install -e ".[test]" |
| 31 |
pytest |
| 32 |
``` |
| 33 |
|
| 34 |
The last command runs the test suite to verify the setup. During development, you can pass filenames to `pytest`, and it will execute only those tests. |
| 35 |
|
| 36 |
## Documentation |
| 37 |
|
| 38 |
The documentation of Jupyter Client is generated from the files in `docs/` using Sphinx. Instructions for setting up Sphinx with a selection of optional modules are in the [Documentation Guide](https://jupyter.readthedocs.io/en/latest/contributing/docs-contributions/index.html). You'll also need the `make` command. |
| 39 |
For a minimal Sphinx installation to process the Jupyter Client docs, execute: |
| 40 |
|
| 41 |
```bash |
| 42 |
pip install ".[doc]" |
| 43 |
``` |
| 44 |
|
| 45 |
The following commands build the documentation in HTML format and check for broken links: |
| 46 |
|
| 47 |
```bash |
| 48 |
cd /my/projects/jupyter_client/docs/ |
| 49 |
make html linkcheck |
| 50 |
``` |
| 51 |
|
| 52 |
Point your browser to the following URL to access the generated documentation: |
| 53 |
|
| 54 |
_file:///my/projects/jupyter_client/docs/\_build/html/index.html_ |
| 55 |
|
| 56 |
## Contributing |
| 57 |
|
| 58 |
`jupyter-client` has adopted automatic code formatting so you shouldn't |
| 59 |
need to worry too much about your code style. |
| 60 |
As long as your code is valid, |
| 61 |
the pre-commit hook should take care of how it should look. |
| 62 |
You can invoke the pre-commit hook by hand at any time with: |
| 63 |
|
| 64 |
```bash |
| 65 |
pre-commit run |
| 66 |
``` |
| 67 |
|
| 68 |
which should run any autoformatting on your code |
| 69 |
and tell you about any errors it couldn't fix automatically. |
| 70 |
You may also install [black integration](https://black.readthedocs.io/en/stable/integrations/editors.html) |
| 71 |
into your text editor to format code automatically. |
| 72 |
|
| 73 |
If you have already committed files before setting up the pre-commit |
| 74 |
hook with `pre-commit install`, you can fix everything up using |
| 75 |
`pre-commit run --all-files`. You need to make the fixing commit |
| 76 |
yourself after that. |
| 77 |
|
| 78 |
Some of the hooks only run on CI by default, but you can invoke them by |
| 79 |
running with the `--hook-stage manual` argument. |
| 80 |
|
| 81 |
## About the Jupyter Development Team |
| 82 |
|
| 83 |
The Jupyter Development Team is the set of all contributors to the Jupyter project. |
| 84 |
This includes all of the Jupyter subprojects. |
| 85 |
|
| 86 |
The core team that coordinates development on GitHub can be found here: |
| 87 |
https://github.com/jupyter/. |
| 88 |
|
| 89 |
## Our Copyright Policy |
| 90 |
|
| 91 |
Jupyter uses a shared copyright model. Each contributor maintains copyright |
| 92 |
over their contributions to Jupyter. But, it is important to note that these |
| 93 |
contributions are typically only changes to the repositories. Thus, the Jupyter |
| 94 |
source code, in its entirety is not the copyright of any single person or |
| 95 |
institution. Instead, it is the collective copyright of the entire Jupyter |
| 96 |
Development Team. If individual contributors want to maintain a record of what |
| 97 |
changes/contributions they have specific copyright on, they should indicate |
| 98 |
their copyright in the commit message of the change, when they commit the |
| 99 |
change to one of the Jupyter repositories. |
| 100 |
|
| 101 |
With this in mind, the following banner should be used in any source code file |
| 102 |
to indicate the copyright and license terms: |
| 103 |
|
| 104 |
``` |
| 105 |
# Copyright (c) Jupyter Development Team. |
| 106 |
# Distributed under the terms of the Modified BSD License. |
| 107 |
``` |
| 108 |
|
| 109 |
[jupyter protocol]: https://jupyter-client.readthedocs.io/en/latest/messaging.html |