# ows-collaborator

## Setup

Install Poetry using one of the methods [described in the documentation](https://python-poetry.org/docs/#installation).

```sh
$ brew install pipx
$ pipx install poetry
```

Install and activate the version of Python specified in [`.python-version`](.python-version), e.g. using [pyenv](https://github.com/pyenv/pyenv).

```sh
$ pyenv install
```

Tell Poetry to use the version of Python currently active in your shell when creating the virtual environment (otherwise it will always use the version it was installed under):

```sh
$ poetry config virtualenvs.prefer-active-python true
```

Install the dependencies (this automatically creates a virtual environment for the project):

```shell
$ make env
```

Copy the environment shadow file and make the necessary changes:

```sh
$ cp .env.shadow .env
```

## Development

Common development commands are defined as Make targets. View the [`Makefile`](Makefile) for the full list.

### Running

Run the dev server:

```sh
$ make dev
```

### Tests

Run the tests:

```sh
$ make test
```

### Linting

Run linting and type checking:

```sh
$ make lint
```

We use [Black](https://github.com/psf/black) to format our code. File are checked for conformance as part of the lint command. To format your code run:

```sh
$ make format
```

Or configure your editor to automatically format on save (e.g. [for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter)).

### Managing dependencies

See the [Poetry documentation](https://python-poetry.org/docs/) for information on how to manage dependencies using the CLI.
