Commit 820cb9c2 authored by trond.aasan's avatar trond.aasan
Browse files

Update docs

parent 651a6d6d
Pipeline #43744 passed with stages
in 3 minutes and 10 seconds
# Contributing to orgreg-client
## The contribution process at a glance
1. Read the [README.md file](README.md).
2. Set up your environment to be able to [run all tests](README.md#running-the-tests). They must pass
3. Prepare your changes:
* Make sure your tests pass cleanly on [mypy](README.md#type-check), [bandit](https://bandit.readthedocs.io/), and [flake8](https://flake8.pycqa.org/)
* [Format your code](#code-style) with `black`
* Create a merge request
## Code style
### Black
This project uses [black](https://github.com/psf/black/) to format the code.
See [black documentation](https://black.readthedocs.io/en/stable/editor_integration.html) for how to set up _black_ with your editor.
To autoformat all code, run
```shell script
git ls-files '*.py' | xargs black
```
[Flake8](https://flake8.pycqa.org/en/latest/) is also used as a linter.
Code style errors will result in CI pipeline failing.
You can use a `pre-commit` hook to have git run linters before commit.
Save this to `.git/hooks/pre-commit` and make it executable.
```sh
#!/bin/sh
tox -e linters
```
# cim-client
[![pipeline status](https://git.app.uib.no/it-bott-integrasjoner/cim-client/badges/master/pipeline.svg)](https://git.app.uib.no/it-bott-integrasjoner/cim-client/-/commits/master)
[![coverage report](https://git.app.uib.no/it-bott-integrasjoner/cim-client/badges/master/coverage.svg)](https://git.app.uib.no/it-bott-integrasjoner/cim-client/-/commits/master)
## Set up development environment
### Virtual environment
#### Create
```bash
virtualenv --python=python3 venv
```
#### Activate
```bash
source venv/bin/activate
```
### Install dependencies
```bash
pip install -r requirements.txt -r requirements-dev.txt -r requirements-test.txt
```
This should install all dependencies, including development dependencies (code formatter, linters etc).
## Running the tests
### Run all tests
Use [tox](https://tox.readthedocs.io/) to run all tests and linters.
```bash
tox
```
### Run pytest
```bash
python -m pytest
```
### Type check
We use static type checker [mypy](http://mypy-lang.org/).
```bash
python -m mypy -p cim_client
```
## Example
Python client for accessing the CIM-API.
```python
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment