Skip to content

Commit 923f588

Browse files
authored
Auto server extension (#190)
* Server extension is auto enabled * Use install to check extension availability * Use tab instead of spaces * Install node dependencies * [DEBUG] * Correct name * Revert [DEBUG] * Update installation.rst
1 parent 808461a commit 923f588

File tree

4 files changed

+11
-24
lines changed

4 files changed

+11
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Install plugin
4545
shell: bash -l {0}
4646
run: |
47-
source ./start_env.sh && make dev-install
47+
source ./start_env.sh && make install
4848
4949
- name: Run linters
5050
shell: bash -l {0}

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ format: # Run formatters
3535
find jupyterlab_code_formatter -name '*.py' | xargs black
3636
npm run format
3737

38+
install:
39+
jlpm install
40+
python -m pip install .
41+
3842
test: # Run test
39-
cd $(SERVEREXTENSION_PATH)
40-
pytest
43+
pytest $(SERVEREXTENSION_PATH)
44+
jupyter server extension list 2>&1 | grep -ie "jupyterlab_code_formatter.*OK"
45+
jupyter labextension list 2>&1 | grep -ie "@ryantam626/jupyterlab_code_formatter.*OK"
4146
python -m jupyterlab.browser_check
4247

4348
publish: # Publish

docs/installation.rst

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ Prerequisites
1414
Installation Step 1 (Installing the plugin itself)
1515
--------------------------------------------------
1616

17-
1.1 Installing the extension
18-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19-
2017
With Pip:
2118

2219
.. code-block:: bash
@@ -28,30 +25,15 @@ With Conda:
2825
.. code-block:: bash
2926
3027
conda install -c conda-forge jupyterlab_code_formatter
31-
32-
1.2 Enabling the Extension
33-
~~~~~~~~~~~~~~~~~~~~~~~~~~
3428
35-
If you are using JupyterLab >= 3.0.0
36-
37-
.. code-block:: bash
38-
39-
jupyter server extension enable jupyterlab_code_formatter
40-
# if you installed the plugin with pip and using --user, you need to add it here as well
41-
jupyter server extension enable --user jupyterlab_code_formatter
42-
43-
...Or if you are still using JupyterLab < 3.0.0
29+
For users still using JupyterLab < 3.0.0, you will also need to run:
4430

4531
.. code-block:: bash
4632
4733
jupyter serverextension enable --py jupyterlab_code_formatter
34+
jupyter labextension install @ryantam626/jupyterlab_code_formatter
4835
4936
50-
.. important::
51-
You will also need to install a code formatter for this plugin to work. The default formatter for Python are :code:`isort` and :code:`black`, and :code:`formatR` for R. Installing these would be a good place to start.
52-
53-
Also for users that haven't upgraded JupyterLab to version 3.0.0+, you will also need to run :code:`jupyter labextension install @ryantam626/jupyterlab_code_formatter`.
54-
5537
Installation Step 2 (Installing a supported code formatter)
5638
-----------------------------------------------------------
5739

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"ServerApp": {
33
"jpserver_extensions": {
4-
"jupyterlab-code-formatter": true
4+
"jupyterlab_code_formatter": true
55
}
66
}
77
}

0 commit comments

Comments
 (0)