Skip to content

Commit 9460c5f

Browse files
committed
how to set up the development environment
1 parent 2534bc5 commit 9460c5f

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,77 @@ It also provides the `jupyter kernelspec` entrypoint
1010
for installing kernelspecs for use with Jupyter frontends.
1111

1212
[Jupyter protocol]: https://jupyter-client.readthedocs.io/en/latest/messaging.html
13+
14+
15+
# Development Setup
16+
17+
To develop and contribute code for Jupyter Client, you should set up
18+
a local development environment where you can run the test suite.
19+
The following steps assume that you have `git`, `python`, `pip`, and `make`
20+
already installed and on the system search path.
21+
You might want to set up the development project in a dedicated
22+
[virtual environment](https://virtualenv.pypa.io/en/stable/) or
23+
[conda environment](https://conda.io/docs/using/envs.html),
24+
depending on what Python distribution you are using.
25+
26+
## Clone the Repository
27+
28+
Fetch the Jupyter Client source code by cloning the GitHub repository,
29+
or [your fork](https://help.github.com/articles/fork-a-repo/) of it.
30+
To clone the original repository into a subdirectory of `/my/projects/`:
31+
32+
cd /my/projects/
33+
git clone https://github.com/jupyter/jupyter_client.git
34+
35+
If you have configured an SSH key pair for GitHub authentication, use the
36+
[SSH URL](https://help.github.com/articles/which-remote-url-should-i-use/)
37+
for cloning instead. But then you already know how to do that anyway.
38+
39+
## Install the Dependencies
40+
41+
The Jupyter Client code depends on several other Python packages at runtime.
42+
The test suite requires a few more packages on top of that.
43+
An [editable install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs)
44+
with `pip` will download the dependencies, and add your local clone of the
45+
Jupyter Client to the Python environment. To create the editable install and
46+
include the dependencies for the test suite:
47+
48+
cd /my/projects/jupyter_client/
49+
pip install -e .[test]
50+
51+
The Jupyter Client documentation is built with
52+
[Sphinx](http://www.sphinx-doc.org/en/stable/). You can install that with `pip`,
53+
or with `conda` you are using an Anaconda distribution.
54+
55+
# in a virtual environment...
56+
pip install sphinx sphinx_rtd_theme
57+
58+
# in a conda environment...
59+
conda install sphinx sphinx_rtd_theme
60+
61+
## Run the Test Suite
62+
63+
Use `pytest` to run the test suite:
64+
65+
cd /my/projects/jupyter_client/
66+
pytest
67+
68+
The full test suite takes a while. During development, you'll probably prefer
69+
to run only the tests relevant to your changes. You can tell `pytest` to
70+
run just the tests from a single file by providing the path to the file.
71+
For example:
72+
73+
cd /my/projects/jupyter_client
74+
pytest jupyter_client/tests/test_session.py
75+
76+
## Build the Documentation
77+
78+
Use `make` to build the documentation in HTML:
79+
80+
cd /my/projects/jupyter_client/docs/
81+
make html
82+
83+
Point your browser to the following URL to access the generated documentation:
84+
85+
[file:///my/projects/jupyter_client/docs/_build/html/index.html]
86+

0 commit comments

Comments
 (0)