diff --git a/CONTRIBUTING b/CONTRIBUTING index 7b8155e8d7a2a9ceda60853393fb43e136ccd893..ab4c2b2dfd84b4c7b498863839753d7d83b4fb6d 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -2,16 +2,62 @@ How to set up your dev environment to work on the grib processor. -First, create a virtual environment like in the [readme](/README.md#setup). +## Goals -Then, install ruff and mypy. +The main goal of this package is to provide a realtime event processor for the SDS that publishes metadata about incoming grib files. As this package is made for the SDS, final say on creative decision goes to the SDS managers. -Before pushing commits run: +The main goal can be accomplished using the `--realtime` CLI option. -`ruff format grib_processor.py` +Additional (secondary) goals include: -`ruff check grib_processor.py` +* Providing different ways to ingest grib files; stdin, specifying one file, etc. +* Providing a python interface to the event processor's components. +* Providing an interface to extract metadata from grib files. -`mypy grib_processor.py` +## Setup ->Note: mypy will give an error about untyped imports, this can be ignored. +First, clone the repo locally. + +```bash +git clone https://gitlab.ssec.wisc.edu/mdrexler/grib_rmq_stream.git +cd grib_rmq_stream +``` + +Next, install the package from source and create a virtual environment like in the [readme](/README.md#setup). + +Then, install the dev dependencies. + +```bash +python -m pip install -r requirements_dev.txt +``` + +Finally, install the package in editable mode. + +```bash +python -m pip install -e . +``` + +### Pre-commit + +[pre-commit](https://pre-commit.com/) can be used to automatically format/lint/type check any new commits you make. It is recommended, but not necessary as the CI will also check that for you. + +```bash +pre-commit install +pre-commit run --all-files +``` + +## Testing + +When adding a new feature, please add corresponding unit tests under [tests/](/tests/). + +Tests can be run using pytest. + +```bash +pytest tests/ +``` + +To get the code coverage use the coverage command. + +```bash +coverage run -m pytest +```