This repository will quickly get you started creating your own webviz-config
plugins π.
Creating a new Python package with webviz-config
plugins is one or two commands only.
-
πͺ Install
cookiecutter
. Ifcookiecutter
is not already installed, we will have to do that first. One approach is to create a new virtual environment and then install it usingpip
:python -m venv ./my_new_venv source ./my_new_venv/bin/activate pip install cookiecutter
-
π Run
cookiecutter
.cookiecutter gh:equinor/webviz-plugin-boilerplate
-
β Fill in the questions asked. Project name, author name etc.
-
π Done! You will now have a new Python package folder (with your project name) generated for you.
The default package created for you contains some dummy plugins. These you can later delete/and or overwrite with your fancy plugins. You can have an arbitrary number of plugins in your package.
To install your plugin package in development mode, run
cd YOUR_PLUGIN_PROJECT
pip install -e .
This will (first time) install all dependencies, but the -e
flag will also make sure your plugin project is installed in edit/development mode. This means that when you update the Python files in your package, this will automatically be available in your current Python environment without having to reinstall the package.
πͺ² If installation of your package fails with
LookupError: setuptools-scm was unable to detect version
, this is because your package is not in a git repository (it tries to use git repository tag as version). We recommend putting your plugin package under version control as e.g. a GitHub repository. This will, in addition to version control, make it easy for others to collaborate on the project, automatic security scan of your dependencies, and other useful stuff.If you for now just want to get the installation done, and wait with creating a repository, you can explicitly set a version (before running
pip install -e .
) using the following command:export SETUPTOOLS_SCM_PRETEND_VERSION=0.1.0
After installation you can test the custom plugins from your package using the provided example configuration file:
webviz build ./examples/basic_example.yaml
You are now ready to modify the package with your own plugins. Have fun! π°