You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and the newer <aclass="reference external" href="https://jupyter-server.readthedocs.io/en/latest/operators/configuring-extensions.html">Jupyter Server</a>.
208
+
Hence, nbgitpuller can be developed locally without needing a JupyterHub.</p>
190
209
<ol>
191
210
<li><p>Fork the nbgitpuller repository and <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">clone</span></code> it to your local computer.</p></li>
192
211
<li><p>Inside the nbgitpuller clone on your local machine, setup a virtual
@@ -196,30 +215,117 @@ <h2>Setup<a class="headerlink" href="#setup" title="Permalink to this headline">
196
215
</pre></div>
197
216
</div>
198
217
</li>
218
+
<li><p>Install development time dependencies in this virtual environment</p>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>jupyter server extension <spanclass="nb">enable</span> --sys-prefix nbclassic
269
+
</pre></div>
270
+
</div>
271
+
<p>or</p>
272
+
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>jupyter server extension <spanclass="nb">enable</span> --sys-prefix jupyterlab
273
+
</pre></div>
274
+
</div>
275
+
</li>
276
+
</ul>
277
+
</li>
215
278
<li><p>You can now test nbgitpuller locally, by hitting the <codeclass="docutils literal notranslate"><spanclass="pre">/git-pull</span></code> url with any
216
279
of the <aclass="reference internal" href="topic/url-options.html"><spanclass="doc std std-doc">URL query parameters</span></a>. For example, to pull the
<li><p>If you make changes to nbgitpuller’s python code, you need to restart the <codeclass="docutils literal notranslate"><spanclass="pre">jupyter</span><spanclass="pre">notebook</span></code>
287
+
process (started in step 5) to see your changes take effect. This is not needed if
288
+
you are only working on the javascript or css.</p></li>
<h2>Running the flake8 linter<aclass="headerlink" href="#running-the-flake8-linter" title="Permalink to this headline">¶</a></h2>
293
+
<p><aclass="reference external" href="https://flake8.pycqa.org/en/latest/">flake8</a> is used to validate python coding style. The
294
+
flake8 config is in <codeclass="docutils literal notranslate"><spanclass="pre">.flake8</span></code>, and is not super strict. You should be able to run
295
+
<codeclass="docutils literal notranslate"><spanclass="pre">flake8</span></code> in the root directory of the repository to get a list of issues to be fixed.</p>
296
+
</div>
297
+
<divclass="section" id="running-tests">
298
+
<h2>Running tests<aclass="headerlink" href="#running-tests" title="Permalink to this headline">¶</a></h2>
299
+
<p><aclass="reference external" href="https://docs.pytest.org/">pytest</a> is used to run unit and integration tests,
300
+
under the <codeclass="docutils literal notranslate"><spanclass="pre">tests/</span></code> directory. If you add new functionality, you should also add
301
+
tests to cover it. You can run the tests locally with <codeclass="docutils literal notranslate"><spanclass="pre">py.test</span><spanclass="pre">tests/</span></code></p>
302
+
</div>
303
+
<divclass="section" id="building-documentation">
304
+
<h2>Building documentation<aclass="headerlink" href="#building-documentation" title="Permalink to this headline">¶</a></h2>
305
+
<p><aclass="reference external" href="https://www.sphinx-doc.org/">sphinx</a> is used to write and maintain documentation, under
306
+
the <codeclass="docutils literal notranslate"><spanclass="pre">docs/</span></code> directory. If you add any new functionality, you should write documentaiton
307
+
for it as well. A mix of <aclass="reference external" href="https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html">reStructuredText</a>
308
+
and <aclass="reference external" href="https://myst-parser.readthedocs.io">MyST Markdown</a> is used to write our documentation,
309
+
although we would like to migrate purely to MyST markdown in the future.</p>
310
+
<ol>
311
+
<li><p>Install the packages needed to build the documentation</p>
<li><p>Build the documentation by using <codeclass="docutils literal notranslate"><spanclass="pre">make</span></code> inside the <codeclass="docutils literal notranslate"><spanclass="pre">docs</span></code> folder. This will
<li><p>Preview the documentation by opening <codeclass="docutils literal notranslate"><spanclass="pre">_build/html/index.html</span></code> file in
324
+
your browser. From inside the <codeclass="docutils literal notranslate"><spanclass="pre">docs</span></code> folder, you can run either
325
+
<codeclass="docutils literal notranslate"><spanclass="pre">open</span><spanclass="pre">_build/html/index.html</span></code> (on MacOS) or <codeclass="docutils literal notranslate"><spanclass="pre">xdg-open</span><spanclass="pre">_build/html/index.html</span></code>
326
+
to quickly open the file in the browser.</p></li>
327
+
<li><p>You can run <codeclass="docutils literal notranslate"><spanclass="pre">make</span><spanclass="pre">html</span></code> again after making further changes to see their
328
+
effects.</p></li>
223
329
</ol>
224
330
</div>
225
331
</div>
@@ -228,12 +334,32 @@ <h2>Setup<a class="headerlink" href="#setup" title="Permalink to this headline">
0 commit comments