From 30be4edd0465948179422224568b94d327183097 Mon Sep 17 00:00:00 2001 From: navdeepgill14 <85558699+navdeepgill14@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:34:57 +1100 Subject: [PATCH 1/3] Added "yarn" and "npm" steps in CONTRIBUTING.md Added the steps to use while setting up an environment using "yarn" and "npm" depending on user preference. --- CONTRIBUTING.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88a518475c..1d0dd2aa8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ for a friendly and welcoming collaborative environment. Note: You will need NodeJS to build the extension package. The `jlpm` command is JupyterLab's pinned version of [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use -`yarn` or `npm` in lieu of `jlpm` below. +`yarn` or `npm` mentioned as an alternative, in lieu of `jlpm` below. **Note**: we recommend using `mamba` to speed the creating of the environment. @@ -62,6 +62,47 @@ Config dir: /usr/local/etc/jupyter Then start Jupyter Notebook with: +```bash +jupyter notebook +``` +### Alternative : Using "yarn" and "npm" over "mamba" + +If you prefer using `yarn` or `npm` over `mamba`, you can follow these steps to set up your development environment: + +Clone the Repository: +```bash +git clone https://github.com/jupyter/notebook.git +cd notebook +``` + +Install NodeJS Dependencies: +If you're using `yarn`: +```bash +yarn install +``` +If you're using `npm`: +```bash +npm install +``` +### Set Up a Python Virtual Environment: +As the Jupyter Notebook includes a Jupyter Server extension written in Python, it's recommended to create a virtual environment. You can use the `venv` module for this: +```bash +python -m venv venv +source venv/bin/activate # On Windows, use: venv\Scripts\activate +``` +Install Python Dependencies: +```bash +pip install -e ".[dev,test]" +``` +Build the Notebook: +```bash +jlpm build +``` +Enable the Server Extension: +```bash +jupyter server extension enable notebook +``` +Start Jupyter Notebook: ```bash jupyter notebook ``` From 98a9d04909e6038513d89e758a2b781d660dd665 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 00:05:42 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d0dd2aa8d..1f22f59d7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ Then start Jupyter Notebook with: ```bash jupyter notebook ``` -### Alternative : Using "yarn" and "npm" over "mamba" +### Alternative : Using "yarn" and "npm" over "mamba" If you prefer using `yarn` or `npm` over `mamba`, you can follow these steps to set up your development environment: From df4f992664f1c36feb626932b6d85bea0c9dc5b4 Mon Sep 17 00:00:00 2001 From: navdeepgill14 <85558699+navdeepgill14@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:43:08 +1100 Subject: [PATCH 3/3] Updated CONTRIBUTING.md based on PR feedback --- CONTRIBUTING.md | 60 ++++++++++++++----------------------------------- 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f22f59d7b..1d90e01d00 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ for a friendly and welcoming collaborative environment. Note: You will need NodeJS to build the extension package. The `jlpm` command is JupyterLab's pinned version of [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use -`yarn` or `npm` mentioned as an alternative, in lieu of `jlpm` below. +`yarn` or `npm`, in lieu of `jlpm` below. **Note**: we recommend using `mamba` to speed the creating of the environment. @@ -30,9 +30,24 @@ jlpm develop # Enable the server extension jupyter server extension enable notebook ``` +### Set Up a Python Virtual Environment: +As the Jupyter Notebook includes a Jupyter Server extension written in Python, it's recommended to create a virtual environment. You can use the `venv` module for this: +```bash +python -m venv venv +source venv/bin/activate # On Windows, use: venv\Scripts\activate +``` +After setting up the environment (either with mamba or venv), you'll need to handle the JavaScript dependencies: +Install NodeJS Dependencies: +If you're using `yarn`: +```bash +yarn install +``` +If you're using `npm`: +```bash +npm install +``` `notebook` follows a monorepo structure. To build all the packages at once: - ```bash jlpm build ``` @@ -62,47 +77,6 @@ Config dir: /usr/local/etc/jupyter Then start Jupyter Notebook with: -```bash -jupyter notebook -``` -### Alternative : Using "yarn" and "npm" over "mamba" - -If you prefer using `yarn` or `npm` over `mamba`, you can follow these steps to set up your development environment: - -Clone the Repository: -```bash -git clone https://github.com/jupyter/notebook.git -cd notebook -``` - -Install NodeJS Dependencies: -If you're using `yarn`: -```bash -yarn install -``` -If you're using `npm`: -```bash -npm install -``` -### Set Up a Python Virtual Environment: -As the Jupyter Notebook includes a Jupyter Server extension written in Python, it's recommended to create a virtual environment. You can use the `venv` module for this: -```bash -python -m venv venv -source venv/bin/activate # On Windows, use: venv\Scripts\activate -``` -Install Python Dependencies: -```bash -pip install -e ".[dev,test]" -``` -Build the Notebook: -```bash -jlpm build -``` -Enable the Server Extension: -```bash -jupyter server extension enable notebook -``` -Start Jupyter Notebook: ```bash jupyter notebook ```