Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add install script #361

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
6 changes: 4 additions & 2 deletions doc/dev_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/openego/eDisGo/blob/dev/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


Expand Down
1 change: 0 additions & 1 deletion edisgo/tools/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
37 changes: 37 additions & 0 deletions install_edisgo_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Script to install the venv in the ./venv dir, install pre-commit hooks.

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