2022-11-13 20:57:27 +00:00
|
|
|
# Contributing to Takahē
|
|
|
|
|
|
|
|
## Getting Started
|
|
|
|
|
2022-11-20 18:17:09 +00:00
|
|
|
Development can be done "bare metal" or with Docker. We'll describe both here.
|
2022-11-13 20:57:27 +00:00
|
|
|
|
|
|
|
|
2022-11-20 18:17:09 +00:00
|
|
|
### Bare Metal
|
2022-11-13 20:57:27 +00:00
|
|
|
|
2022-11-20 18:54:23 +00:00
|
|
|
Takahē requires Python 3.10 or above, so you'll need that first. Then, create and
|
2022-11-20 18:17:09 +00:00
|
|
|
activate a virtual environment:
|
2022-11-13 20:57:27 +00:00
|
|
|
|
2022-11-20 18:17:09 +00:00
|
|
|
```shell
|
|
|
|
$ python3 -m venv .venv
|
|
|
|
$ . .venv/bin/activate
|
2022-11-13 20:57:27 +00:00
|
|
|
```
|
2022-11-20 18:17:09 +00:00
|
|
|
|
|
|
|
You can install the development requirements:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ pip install -r requirements-dev.txt
|
2022-11-13 20:57:27 +00:00
|
|
|
```
|
|
|
|
|
2022-11-20 18:17:09 +00:00
|
|
|
...and enable git commit hooks if you like:
|
2022-11-13 20:57:27 +00:00
|
|
|
|
|
|
|
```bash
|
2022-11-20 18:17:09 +00:00
|
|
|
$ pre-commit install
|
2022-11-13 20:57:27 +00:00
|
|
|
```
|
|
|
|
|
2022-11-20 18:17:09 +00:00
|
|
|
Finally, you can run the tests with PyTest:
|
2022-11-13 20:57:27 +00:00
|
|
|
|
|
|
|
```bash
|
2022-11-20 18:17:09 +00:00
|
|
|
$ pytest
|
2022-11-13 20:57:27 +00:00
|
|
|
```
|
|
|
|
|
2022-11-20 18:17:09 +00:00
|
|
|
|
|
|
|
### Docker
|
|
|
|
|
|
|
|
The docker build process will take care of much of the above, but you just have
|
|
|
|
to be sure that you're executing it from the project root.
|
|
|
|
|
|
|
|
First, you need to build your image:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ docker build -f ./docker/Dockerfile -t "takahe:latest" .
|
|
|
|
```
|
|
|
|
|
|
|
|
Then start the `compose` session:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ docker compose -f docker/docker-compose.yml up
|
|
|
|
```
|
|
|
|
|
|
|
|
Once your session is up and running, you can run the tests inside your
|
|
|
|
container:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ docker compose -f docker/docker-compose.yml exec web pytest
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2022-11-13 20:57:27 +00:00
|
|
|
# Code of Conduct
|
|
|
|
|
|
|
|
As a contributor, you can help us keep the Takahē community open and inclusive. Takahē
|
|
|
|
follows the [Django Project Code of Conduct](https://www.djangoproject.com/conduct/).
|