Skip to content

Commit

Permalink
add development documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhundhausen committed Jan 30, 2024
1 parent fc6165e commit e3f0f84
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Instructions for development

## Dependency management and dev environment
Poetry is used as a backend for packaging and for dependency
management. To set up a working development environment, create
a virtual environment and install the `poetry` python package.
Then install all develpoment dependencies:

```bash
[email protected] -m venv <name_of_venv>
source <name_of_venv>/bin/activate
pip install poetry
poetry install
```

## Testing
The tests are maintained in the subpackages under `tests`, e.g.
`menu_tools/object_performance/tests`. After properly setting up
a development environment as described [above](#dependency-management-and-dev-environment)
you can simply run

```bash
pytest -vv
```

to run all tests. The `-vv` option is optional and can be omitted.
For some of the tests the presence of the V29 caching files is required.


## Code Formatting and Linting
`black` is used for code formatting and `flake8` for linting.
These tools are helpful to have consistent formatting through
the codebase even with multiple developers working on the code.
To run `black`, set up the development environment as described
[above](#dependency-management-and-dev-environment) and run

```bash
black menu_tools
```

If you want to dry-run, add the `--check` flag to see which files would
be modified.
Similarlly `flake8` can be run by simply typing

```bash
flake8 menu_tools
```

0 comments on commit e3f0f84

Please sign in to comment.