diff --git a/README.md b/README.md index 0318437..1c31151 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,39 @@ cp resources/config.sample.json config.20240405.json ``` Then ``scicat_ingestor`` will automatically use the configuration file. + +## Developer's Guide + +### Virtual Environments +We use [pip-compile-multi](https://pip-compile-multi.readthedocs.io/en/latest/) to maintain +the `pip` recipes under `requirements`. +Each `*.in` files have the dependencies for specific purposes and `*.txt` files are compiled frozen dependencies. +`base.in` is auto-generated by `make_base.py` script based on `pyproject.toml`, +but you can add/pin dependencies manually above the marker in the file. + +We use [tox](#Tox) command, `tox -e deps` to freeze the dependencies. + +### Pre-commit Hooks +We use `pre-commit` for formatting and static analysis of the code. +Once you clone the repository and set up the virtual environment (i.e. installed `requirements/dev.txt`) +you need to install [pre-commit](https://pre-commit.com/index.html) by +```bash +pre-commit install +``` +`pre-commit` will be hooked whenever you make a `git commit` and screen the files of interest. + +It will not pass CI test if `pre-commit` complains. +If you want to push the change while having a PR open, even if you know that `pre-commit hooks` fail, +you can add `[ci-skip]` tag in your commit and CI action will be skipped. + +### Copier Template +This repository was based on [scipp/copier_template](https://github.com/scipp/copier_template). +We can apply common updates/dependency updates using +```bash +copier update +``` + +### Tox +`tox` controls virtual environment and commands for various purposes. +Developers and CI actions can use the command. +For example, `tox -e docs` builds documentation under `./html` directory and `tox -e py310` will run unit tests with python version `3.10`.