Repository: a-r-j/graphein (language: python)

Issue:
docker compose fails to build due to jupyter nbextension
**Describe the bug**
When I ran `docker compose up -d --build`, 'jupyter-nbextension' seems to break it.

**To Reproduce**

Steps to reproduce the behavior:
1) clone & cd repo
2) run:
comp@usr:~/repos/graphein$ docker compose up -d --build
[+] Building 1842.7s (26/26) FINISHED                                                                                                                                                                                                                            docker:default
 => [graphein-gpu internal] load build definition from Dockerfile                                                                                                                                                                                                          0.0s
 => => transferring dockerfile: 2.68kB                                                                                                                                                                                                                                     0.0s
 => [graphein-gpu internal] load metadata for docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime                                                                                                                                                                     1.2s
 => [graphein-gpu internal] load .dockerignore                                                                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                            0.0s
 => [graphein-gpu  1/22] FROM docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime@sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe                                                                                                           168.4s
 => => resolve docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime@sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe                                                                                                                            0.0s
 => => sha256:a404e54162968593b8d92b571f3cdd673e4c9eab5d9be28d7c494595c0aa6682 26.71MB / 26.71MB                                                                                                                                                                           0.6s
 => => sha256:d70bbcbd9fa5ac5613648594bc56c2c1c74c0dfcbe4ff22f0f20b79b2a49b591 9.92MB / 9.92MB                                                                                                                                                                             0.9s
 => => sha256:2f8d87f6e9b576cc8aafb6a58c866a9516611d549be360361c2126d91ab6a3e6 5.64GB / 5.64GB                                                                                                                                                                            86.4s
 => => sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe 1.16kB / 1.16kB                                                                                                                                                                             0.0s
 => => sha256:1c9fb6f6f844dd852801691b87755ec1ee1693c6c28c70fc93106b2f49c97971 2.83kB / 2.83kB                                                                                                                                                                             0.0s
 => => extracting sha256:a404e54162968593b8d92b571f3cdd673e4c9eab5d9be28d7c494595c0aa6682                                                                                                                                                                                  0.8s
 => => sha256:f0869fc5825082f7a44b0c9973d3d977f89a1589fe12881e53900346ba3e4863 98B / 98B                                                                                                                                                                                   0.8s
 => => extracting sha256:d70bbcbd9fa5ac5613648594bc56c2c1c74c0dfcbe4ff22f0f20b79b2a49b591                                                                                                                                                                                  0.7s
 => => extracting sha256:2f8d87f6e9b576cc8aafb6a58c866a9516611d549be360361c2126d91ab6a3e6                                                                                                                                                                                 80.8s
 => => extracting sha256:f0869fc5825082f7a44b0c9973d3d977f89a1589fe12881e53900346ba3e4863                                                                                                                                                                                  0.0s
 => [graphein-gpu internal] load build context                                                                                                                                                                                                                             0.0s
 => => transferring context: 1.08kB                                                                                                                                                                                                                                        0.0s
 => [graphein-gpu  2/22] RUN apt-get update     && apt-get -y install build-essential ffmpeg libsm6 libxext6 wget git     && rm -rf /var/lib/apt/lists/*                                                                                                                  66.0s
 => [graphein-gpu  3/22] RUN apt-get update && apt-get install -y iputils-ping && apt-get clean     && rm -rf /var/lib/apt/lists/*                                                                                                                                         6.5s 
 => [graphein-gpu  4/22] RUN apt-get update && apt-get install -y ncbi-blast+ && apt-get clean     && rm -rf /var/lib/apt/lists/*                                                                                                                                         11.9s 
 => [graphein-gpu  5/22] RUN apt-get update && apt-get install -y dssp && apt-get clean     && rm -rf /var/lib/apt/lists/*                                                                                                                                                 5.6s 
 => [graphein-gpu  6/22] RUN mkdir -p graphein/requirements                                                                                                                                                                                                                0.6s 
 => [graphein-gpu  7/22] WORKDIR /graphein                                                                                                                                                                                                                                 0.0s 
 => [graphein-gpu  8/22] COPY .requirements /graphein/requirements                                                                                                                                                                                                         0.0s 
 => [graphein-gpu  9/22] RUN echo "$(cat requirements/base.in)" >> requirements.txt     && echo "$(cat requirements/dev.in)" >> requirements.txt     && echo "$(cat requirements/extras.in)" >> requirements.txt                                                           0.7s 
 => [graphein-gpu 10/22] RUN pip install -r requirements.txt --no-cache-dir                                                                                                                                                                                               63.6s 
 => [graphein-gpu 11/22] RUN conda install -c conda-forge libgcc-ng                                                                                                                                                                                                       22.2s 
 => [graphein-gpu 12/22] RUN conda install scipy scikit-learn matplotlib pandas cython ipykernel                                                                                                                                                                          74.4s 
 => [graphein-gpu 13/22] RUN pip install ticc==0.1.4 --no-cache-dir                                                                                                                                                                                                        1.6s 
 => [graphein-gpu 14/22] RUN conda install -c conda-forge vmd-python                                                                                                                                                                                                     633.1s 
 => [graphein-gpu 15/22] RUN git clone https://github.com/getcontacts/getcontacts.git                                                                                                                                                                                      3.6s 
 => [graphein-gpu 16/22] RUN conda install -c fvcore -c iopath -c conda-forge fvcore iopath                                                                                                                                                                               50.4s 
 => [graphein-gpu 17/22] RUN conda install -c pytorch3d pytorch3d                                                                                                                                                                                                         14.6s 
 => [graphein-gpu 18/22] RUN conda install -c dglteam dgl                                                                                                                                                                                                                 15.1s 
 => [graphein-gpu 19/22] RUN conda install -c conda-forge ipywidgets                                                                                                                                                                                                      49.5s 
 => [graphein-gpu 20/22] RUN export CUDA=$(python -c "import torch; print('cu'+torch.version.cuda.replace('.',''))")     && export TORCH=$(python -c "import torch; print(torch.__version__)")     && pip install torch-scatter -f https://pytorch-geometric.com/whl/to  640.4s 
 => [graphein-gpu 21/22] RUN pip install jupyter_contrib_nbextensions                                                                                                                                                                                                     12.9s 
 => ERROR [graphein-gpu 22/22] RUN jupyter nbextension enable --py widgetsnbextension                                                                                                                                                                                      0.5s 
------                                                                                                                                                                                                                                                                          
 > [graphein-gpu 22/22] RUN jupyter nbextension enable --py widgetsnbextension:                                                                                                                                                                                                 
0.433 usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]                                                                                                                                                                                               
0.433                [--paths] [--json] [--debug]                                                                                                                                                                                                                               
0.433                [subcommand]                                                                                                                                                                                                                                               
0.433                                                                                                                                                                                                                                                                           
0.433 Jupyter: Interactive Computing
0.433 
0.433 positional arguments:
0.433   subcommand     the subcommand to launch
0.433 
0.433 optional arguments:
0.433   -h, --help     show this help message and exit
0.433   --version      show the versions of core jupyter packages and exit
0.433   --config-dir   show Jupyter config dir
0.433   --data-dir     show Jupyter data dir
0.433   --runtime-dir  show Jupyter runtime dir
0.433   --paths        show all Jupyter paths. Add --json for machine-readable
0.433                  format.
0.433   --json         output paths as machine-readable json
0.433   --debug        output debug information about paths
0.433 
0.433 Available subcommands: contrib dejavu events execute kernel kernelspec lab
0.433 labextension labhub migrate nbconvert nbextensions_configurator notebook run
0.433 server troubleshoot trust
0.433 
0.433 Jupyter command `jupyter-nbextension` not found.
------
failed to solve: process "/bin/sh -c jupyter nbextension enable --py widgetsnbextension" did not complete successfully: exit code: 1

**Desktop (please complete the following information):**

- OS: Ubuntu 22.04.4 LTS (GNU/Linux 6.5.0-18-generic x86_64)
- Docker version 25.0.3, build 4debf41 
- Python Version: as specified in Dockerfile (3.8 I think)
- Graphein Version [e.g. 22] & how it was installed: freshly cloned (master)

**Additional context**
It also looks like you should be able to upgrade torch to 2.2.0 now and set python=3.10  (#290 ), so in case you make a new Dockerfile to fix this bug, it might be a good time to include this too. 

docker compose fails to build due to jupyter nbextension
**Describe the bug**
When I ran `docker compose up -d --build`, 'jupyter-nbextension' seems to break it.

**To Reproduce**

Steps to reproduce the behavior:
1) clone & cd repo
2) run:
comp@usr:~/repos/graphein$ docker compose up -d --build
[+] Building 1842.7s (26/26) FINISHED                                                                                                                                                                                                                            docker:default
 => [graphein-gpu internal] load build definition from Dockerfile                                                                                                                                                                                                          0.0s
 => => transferring dockerfile: 2.68kB                                                                                                                                                                                                                                     0.0s
 => [graphein-gpu internal] load metadata for docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime                                                                                                                                                                     1.2s
 => [graphein-gpu internal] load .dockerignore                                                                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                            0.0s
 => [graphein-gpu  1/22] FROM docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime@sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe                                                                                                           168.4s
 => => resolve docker.io/pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime@sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe                                                                                                                            0.0s
 => => sha256:a404e54162968593b8d92b571f3cdd673e4c9eab5d9be28d7c494595c0aa6682 26.71MB / 26.71MB                                                                                                                                                                           0.6s
 => => sha256:d70bbcbd9fa5ac5613648594bc56c2c1c74c0dfcbe4ff22f0f20b79b2a49b591 9.92MB / 9.92MB                                                                                                                                                                             0.9s
 => => sha256:2f8d87f6e9b576cc8aafb6a58c866a9516611d549be360361c2126d91ab6a3e6 5.64GB / 5.64GB                                                                                                                                                                            86.4s
 => => sha256:8711d55e2b5c42f3c070e1f2bacc2d1988c9b3b5b99694abc6691a852536efbe 1.16kB / 1.16kB                                                                                                                                                                             0.0s
 => => sha256:1c9fb6f6f844dd852801691b87755ec1ee1693c6c28c70fc93106b2f49c97971 2.83kB / 2.83kB                                                                                                                                                                             0.0s
 => => extracting sha256:a404e54162968593b8d92b571f3cdd673e4c9eab5d9be28d7c494595c0aa6682                                                                                                                                                                                  0.8s
 => => sha256:f0869fc5825082f7a44b0c9973d3d977f89a1589fe12881e53900346ba3e4863 98B / 98B                                                                                                                                                                                   0.8s
 => => extracting sha256:d70bbcbd9fa5ac5613648594bc56c2c1c74c0dfcbe4ff22f0f20b79b2a49b591                                                                                                                                                                                  0.7s
 => => extracting sha256:2f8d87f6e9b576cc8aafb6a58c866a9516611d549be360361c2126d91ab6a3e6                                                                                                                                                                                 80.8s
 => => extracting sha256:f0869fc5825082f7a44b0c9973d3d977f89a1589fe12881e53900346ba3e4863                                                                                                                                                                                  0.0s
 => [graphein-gpu internal] load build context                                                                                                                                                                                                                             0.0s
 => => transferring context: 1.08kB                                                                                                                                                                                                                                        0.0s
 => [graphein-gpu  2/22] RUN apt-get update     && apt-get -y install build-essential ffmpeg libsm6 libxext6 wget git     && rm -rf /var/lib/apt/lists/*                                                                                                                  66.0s
 => [graphein-gpu  3/22] RUN apt-get update && apt-get install -y iputils-ping && apt-get clean     && rm -rf /var/lib/apt/lists/*                                                                                                                                         6.5s 
 => [graphein-gpu  4/22] RUN apt-get update && apt-get install -y ncbi-blast+ && apt-get clean     && rm -rf /var/lib/apt/lists/*                                                                                                                                         11.9s 
 => [graphein-gpu  5/22] RUN apt-get update && apt-get install -y dssp && apt-get clean     && rm -rf /var/lib/apt/lists/*                                                                                                                                                 5.6s 
 => [graphein-gpu  6/22] RUN mkdir -p graphein/requirements                                                                                                                                                                                                                0.6s 
 => [graphein-gpu  7/22] WORKDIR /graphein                                                                                                                                                                                                                                 0.0s 
 => [graphein-gpu  8/22] COPY .requirements /graphein/requirements                                                                                                                                                                                                         0.0s 
 => [graphein-gpu  9/22] RUN echo "$(cat requirements/base.in)" >> requirements.txt     && echo "$(cat requirements/dev.in)" >> requirements.txt     && echo "$(cat requirements/extras.in)" >> requirements.txt                                                           0.7s 
 => [graphein-gpu 10/22] RUN pip install -r requirements.txt --no-cache-dir                                                                                                                                                                                               63.6s 
 => [graphein-gpu 11/22] RUN conda install -c conda-forge libgcc-ng                                                                                                                                                                                                       22.2s 
 => [graphein-gpu 12/22] RUN conda install scipy scikit-learn matplotlib pandas cython ipykernel                                                                                                                                                                          74.4s 
 => [graphein-gpu 13/22] RUN pip install ticc==0.1.4 --no-cache-dir                                                                                                                                                                                                        1.6s 
 => [graphein-gpu 14/22] RUN conda install -c conda-forge vmd-python                                                                                                                                                                                                     633.1s 
 => [graphein-gpu 15/22] RUN git clone https://github.com/getcontacts/getcontacts.git                                                                                                                                                                                      3.6s 
 => [graphein-gpu 16/22] RUN conda install -c fvcore -c iopath -c conda-forge fvcore iopath                                                                                                                                                                               50.4s 
 => [graphein-gpu 17/22] RUN conda install -c pytorch3d pytorch3d                                                                                                                                                                                                         14.6s 
 => [graphein-gpu 18/22] RUN conda install -c dglteam dgl                                                                                                                                                                                                                 15.1s 
 => [graphein-gpu 19/22] RUN conda install -c conda-forge ipywidgets                                                                                                                                                                                                      49.5s 
 => [graphein-gpu 20/22] RUN export CUDA=$(python -c "import torch; print('cu'+torch.version.cuda.replace('.',''))")     && export TORCH=$(python -c "import torch; print(torch.__version__)")     && pip install torch-scatter -f https://pytorch-geometric.com/whl/to  640.4s 
 => [graphein-gpu 21/22] RUN pip install jupyter_contrib_nbextensions                                                                                                                                                                                                     12.9s 
 => ERROR [graphein-gpu 22/22] RUN jupyter nbextension enable --py widgetsnbextension                                                                                                                                                                                      0.5s 
------                                                                                                                                                                                                                                                                          
 > [graphein-gpu 22/22] RUN jupyter nbextension enable --py widgetsnbextension:                                                                                                                                                                                                 
0.433 usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]                                                                                                                                                                                               
0.433                [--paths] [--json] [--debug]                                                                                                                                                                                                                               
0.433                [subcommand]                                                                                                                                                                                                                                               
0.433                                                                                                                                                                                                                                                                           
0.433 Jupyter: Interactive Computing
0.433 
0.433 positional arguments:
0.433   subcommand     the subcommand to launch
0.433 
0.433 optional arguments:
0.433   -h, --help     show this help message and exit
0.433   --version      show the versions of core jupyter packages and exit
0.433   --config-dir   show Jupyter config dir
0.433   --data-dir     show Jupyter data dir
0.433   --runtime-dir  show Jupyter runtime dir
0.433   --paths        show all Jupyter paths. Add --json for machine-readable
0.433                  format.
0.433   --json         output paths as machine-readable json
0.433   --debug        output debug information about paths
0.433 
0.433 Available subcommands: contrib dejavu events execute kernel kernelspec lab
0.433 labextension labhub migrate nbconvert nbextensions_configurator notebook run
0.433 server troubleshoot trust
0.433 
0.433 Jupyter command `jupyter-nbextension` not found.
------
failed to solve: process "/bin/sh -c jupyter nbextension enable --py widgetsnbextension" did not complete successfully: exit code: 1

**Desktop (please complete the following information):**

- OS: Ubuntu 22.04.4 LTS (GNU/Linux 6.5.0-18-generic x86_64)
- Docker version 25.0.3, build 4debf41 
- Python Version: as specified in Dockerfile (3.8 I think)
- Graphein Version [e.g. 22] & how it was installed: freshly cloned (master)

**Additional context**
It also looks like you should be able to upgrade torch to 2.2.0 now and set python=3.10  (#290 ), so in case you make a new Dockerfile to fix this bug, it might be a good time to include this too. 



Discussion / hints:
Thanks for flagging @avivko!

Looks like Jupyter Notebook 7+ doesn't support `jupyter-nbextension`. Any preferences on how to resolve? I suppose pinning the notebook version to <7 seems simplest.
@a-r-j Yeah, looks like it is the easiest solution. Another solution could be using [nbclassic](https://github.com/jupyter/nbclassic) with a newer server-backend. But I think you can go with setting Jupyter Notebook < 6.5 and revisit this in case there are incompatibilities with this in future releases of Graphein
Thanks for flagging @avivko!

Looks like Jupyter Notebook 7+ doesn't support `jupyter-nbextension`. Any preferences on how to resolve? I suppose pinning the notebook version to <7 seems simplest.
@a-r-j Yeah, looks like it is the easiest solution. Another solution could be using [nbclassic](https://github.com/jupyter/nbclassic) with a newer server-backend. But I think you can go with setting Jupyter Notebook < 6.5 and revisit this in case there are incompatibilities with this in future releases of Graphein

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 76d8335d..e557a3f9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,11 @@
 ### 1.7.7 - UNRELEASED
 
 ### Bugfixes
-
 * Fix bug where the `deprotonate` argument is not wired up to `graphein.protein.graphs.construct_graphs`. [#375](https://github.com/a-r-j/graphein/pull/375)
-* Remove `typing_extension` as dependency since we now only support Python >=3.8 and `Literal` is included in `typing` there.
+
+#### Misc
+* Resolve issue with notebook version and `pluggy` in Dockerfile. [#372](https://github.com/a-r-j/graphein/pull/372)
+* Remove `typing_extension` as dependency since we now primarily support Python >=3.8 and `Literal` is included in `typing` there.
 
 ### 1.7.6
 
diff --git a/Dockerfile b/Dockerfile
index c0b29c11..ecbbcb68 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,8 +28,10 @@ RUN echo "$(cat requirements/base.in)" >> requirements.txt \
     && echo "$(cat requirements/dev.in)" >> requirements.txt \
     && echo "$(cat requirements/extras.in)" >> requirements.txt
 
+RUN pip install notebook==6.*
 RUN pip install -r requirements.txt --no-cache-dir
 
+RUN conda install conda-forge::pluggy
 RUN conda install -c conda-forge libgcc-ng
 RUN conda install scipy scikit-learn matplotlib pandas cython ipykernel
 RUN pip install ticc==0.1.4 --no-cache-dir


Test patch:
diff --git a/.github/workflows/code-tests-docker.yaml b/.github/workflows/code-tests-docker.yaml
index e483b30a..cc8d31a8 100644
--- a/.github/workflows/code-tests-docker.yaml
+++ b/.github/workflows/code-tests-docker.yaml
@@ -1,6 +1,13 @@
 name: Code tests (docker)
 
-on: [pull_request]
+on:
+  pull_request:
+      paths-ignore:
+      - "README.md"
+      - "CHANGELOG.md"
+      - "CONTRIBUTORS.md"
+      - "CONTRIBUTING.md"
+      - "docs/**"
 
 jobs:
   code-tests-docker: