From 71002f79706d157505ca4143e84aa955b93cb30b Mon Sep 17 00:00:00 2001 From: Malte Jahn Date: Mon, 20 Mar 2023 09:17:42 +0100 Subject: [PATCH 1/4] Add install script --- .gitignore | 3 +++ install_edisgo_dev.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 install_edisgo_dev.sh diff --git a/.gitignore b/.gitignore index 5d4ac8302..69b7110c9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ eDisGo.egg-info/ # exclude .json files in opf /edisgo/opf/edisgo_scenario_data/*.json /edisgo/opf/opf_solutions/*.json + +# exclude virtualenv dir +venv/ diff --git a/install_edisgo_dev.sh b/install_edisgo_dev.sh new file mode 100755 index 000000000..9403dc910 --- /dev/null +++ b/install_edisgo_dev.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Script to install the venv in the ./venv dir, install pre-commit hooks and build jupyterlab. + +set -euo pipefail +#set -x + +workflow_dir="$(dirname "$(realpath -s "$0")")" + +cd "$workflow_dir" + +if [ -d "venv" ] +then + rm -rf "venv" +else + echo No dir venv. +fi + +virtualenv "venv" --python python3.8 + +source "$workflow_dir/venv/bin/activate" +python --version +echo "Upgrade pip." +python -m pip -q install --upgrade pip + +for repo in "[dev]" +do + echo "Install $workflow_dir$repo." + python -m pip install -e "$workflow_dir$repo" +done + +echo "Save pip freeze to freeze.txt." +python --version > "$workflow_dir/venv/freeze.txt" +python -m pip -q freeze >> "$workflow_dir/venv/freeze.txt" + + +pre-commit install +jupyter-lab build From 6e0426eab85d7beabc7bcfea3b15a520ca7e5a7f Mon Sep 17 00:00:00 2001 From: Malte Jahn Date: Mon, 20 Mar 2023 09:57:48 +0100 Subject: [PATCH 2/4] Add install script documentation --- doc/dev_notes.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/dev_notes.rst b/doc/dev_notes.rst index c4188f7db..1afa7a264 100644 --- a/doc/dev_notes.rst +++ b/doc/dev_notes.rst @@ -18,13 +18,15 @@ Installation using Linux ~~~~~~~~~~~~~~~~~~~~~~~~ To set up a source installation using linux simply use a virtual environment and install -the source code with pip. Make sure to use python3.7 or higher (recommended +the source code with pip. If you want you can also use the +`install_edisgo_dev.sh `_ +script. Make sure to use python3.7 or higher (recommended python3.8). **After** setting up your virtual environment and activating it run the following commands within your eDisGo directory: .. code-block:: bash - python -m pip install -e .[full] # install eDisGo from source + python -m pip install -e .[dev] # install eDisGo from source pre-commit install # install pre-commit hooks From b5465ea2da2a7216808c3ee4b4ec026f2d305d9d Mon Sep 17 00:00:00 2001 From: Malte Jahn Date: Thu, 23 Mar 2023 16:06:16 +0100 Subject: [PATCH 3/4] Fix failing plotly tests --- edisgo/tools/plots.py | 1 - 1 file changed, 1 deletion(-) diff --git a/edisgo/tools/plots.py b/edisgo/tools/plots.py index 85eca050a..168b05cca 100644 --- a/edisgo/tools/plots.py +++ b/edisgo/tools/plots.py @@ -1543,7 +1543,6 @@ def plot_dash_app( app = JupyterDash(__name__) # Workaround to use standard python logging with plotly dash - logger.handlers.pop() if debug: app.logger.disabled = False app.logger.setLevel(logging.DEBUG) From 09fd830fa1af377ef2b58115f7bef23d5db7b729 Mon Sep 17 00:00:00 2001 From: mltja Date: Tue, 28 Mar 2023 11:11:07 +0200 Subject: [PATCH 4/4] Remove jupyter-lab build --- install_edisgo_dev.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install_edisgo_dev.sh b/install_edisgo_dev.sh index 9403dc910..d66c33e54 100755 --- a/install_edisgo_dev.sh +++ b/install_edisgo_dev.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Script to install the venv in the ./venv dir, install pre-commit hooks and build jupyterlab. +# Script to install the venv in the ./venv dir, install pre-commit hooks. set -euo pipefail #set -x @@ -35,4 +35,3 @@ python -m pip -q freeze >> "$workflow_dir/venv/freeze.txt" pre-commit install -jupyter-lab build