Skip to content

Latest commit

 

History

History
95 lines (66 loc) · 2.71 KB

CONTRIBUTING.md

File metadata and controls

95 lines (66 loc) · 2.71 KB

Contributing to FLorist

Thanks for your interest in contributing!

To submit PRs, please fill out the PR template along with the PR. If the PR fixes an issue, don't forget to link the PR to the issue!

Pre-commit hooks

Once the python virtual environment is setup, you can run pre-commit hooks using:

pre-commit run --all-files

Development dependencies

To install development dependencies, first you need to create a virtual environment. The easiest way is by using the virtualenv package:

virtualenv venv
source venv/bin/activate

We use Poetry to manage back-end dependencies:

pip install --upgrade pip poetry
poetry install --with test

We use Yarn to manage front-end dependencies. Install it on MacOS using Homebrew:

brew install yarn

Then install the project dependencies in development mode:

yarn -D

Install Redis by following these instructions.

Then, run the server and client's Redis instance by following these instructions and these instructions respectively.

To start the server in development mode, run:

yarn dev

Running the tests

To run the python unit tests, simply execute:

pytest florist/tests/unit

To run the nextjs unit tests, simply execute:

yarn unit-test

To run the integration tests, first make sure you:

  • Have a Redis server running on your local machine on port 6379 by following these instructions.
  • Have a MongoDB server running on your local machine on port 27017 by following these instructions.

Then execute:

pytest florist/tests/integration

Coding guidelines

For code style, we recommend the PEP 8 style guide.

For docstrings we use numpy format.

We use ruff for code formatting and static code analysis. Ruff checks various rules including flake8. The pre-commit hooks show errors which you need to fix before submitting a PR.

Last but not the least, we use type hints in our code which is then checked using mypy.

Documentation

Backend code API documentation can be found at https://vectorinstitute.github.io/FLorist/.

Backend REST API documentation can be found at https://localhost:8000/docs once the server is running locally.