This frontend application is part of the FMU Settings applications: The CLI application
starts the API server, which serves both the API and the built GUI. There is also an
fmu-settings package which contains the business logic and models and which is used by
the API. Finally, the fmu-datamodels package contains some additional models used by
FMU Settings.
There are two parts to this repo:
- The code for the React application, located in the
frontenddirectory. This is the main application, containing the web frontend - The code for the Python package, located in the root and in the
srcdirectory. This builds and packages the static React files forfmu-settings-api
Doing a local pip install will attempt to build the React application behind the scenes. This requires a few dependencies (Node, pnpm, ..) that are not installable via pip. View the frontend README for instructions.
The package does not start a web server. It provides
fmu_settings_gui.get_static_directory(), which returns the packaged asset directory.
The API uses this directory when fmu settings starts the complete application.
Be sure to include a verbose flag or two (pip install . -vv) if you need to
observe the frontend installation output.
When developing features in the React application, there are corresponding changes in the other FMU Settings packages that the frontend application needs. It is therefore important to make sure that the other packages are used in their newest versions. Installing these packages from the package repository PyPI might not provide the newest versions, so installations should be done as editable installs. Python will then import functions from the cloned code repos.
A Python virtual environment (venv) should first be created:
python -m venv ~/venv/fmu-settings
source ~/venv/fmu-settings/bin/activateThen, an editable install of a package can be done, with the following steps:
git clone git@github.com:equinor/fmu-settings-cli.git
cd fmu-settings-cli
uv pip install -e ".[dev]"These commands clone the repository and install the package along with its regular and
development dependencies. During developemnt, it is often helpful to work to work with
the latest main branches of related fmu-settings packages. This can be done with the
following command :
uv pip install -r dev_requirements.txtNote : This does not install the packages in editable mode.
Packages installed using the dev_requirements.txt.
fmu-settings-apifmu-settings-clifmu-settingsfmu-datamodelsrms-sys
Tests for the Python applications are run with the following command:
pytest -n auto testsEnsure your changes will pass the various linters before making a pull request. It is expected that all code will be typed and validated with mypy.
ruff check
ruff format --check
mypy src testsSee the contributing document for more.
See the application's README file for information.