diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b974654..6ee5fc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,16 +9,21 @@ The current areas of focus are: ## Table of Contents 📖 -1. [Roadmap](#roadmap) -1. [Support questions & reporting bugs](#support-questions--reporting-bugs) -1. [Development](#development) - 1. [Project structure](#project-structure) - 1. [Environment setup](#environment-setup) - 1. [Coding style](#coding-style) - 1. [Checks & Testing](#checks--testing) - 1. [Docs](#docs) -1. [Release](#release) -1. [Finally](#finally) + +- [Contributing](#contributing) + - [Table of Contents 📖](#table-of-contents-) + - [Roadmap](#roadmap) + - [Support questions & reporting bugs](#support-questions--reporting-bugs) + - [Development](#development) + - [Project structure](#project-structure) + - [Environment setup using docker](#environment-setup-using-docker) + - [Environment setup without docker](#environment-setup-without-docker) + - [Coding style](#coding-style) + - [Checks & Testing](#checks--testing) + - [Docs](#docs) + - [Release](#release) + - [Finally](#finally) + ## Roadmap @@ -64,7 +69,22 @@ root/ * `tests` is the source of the entire test suite, consisting of unit and integration tests. * The top level `Makefile` is a toolbox of useful commands for installing dependencies as well as testing, linting and packaging the code. It is also used as the entrypoint interface for all CI/CD operations. -### Environment setup + + +### Environment setup using docker + +For convenience, you can setup the development environment using the Dockerfile and docker-compose files provided in the repo. + +To set it up, run the command: + +``` bash +docker-compose run asynction +``` + +It will install everything and start the container with bash attached. + +### Environment setup without docker + Use python3.7 or higher. @@ -92,9 +112,9 @@ Use python3.7 or higher. 1. Install the pre-commit hooks - ```bash - $ precommit install - ``` +``` bash + $ pre-commit install +``` ### Coding style @@ -102,7 +122,9 @@ Use python3.7 or higher. * Type annotations are mandatory (even in tests). Avoid the use of `typing.Any` and `# type: ignore`. * All parts of the public API (exposed via `asynction.__init__.py`) should be documented with docstrings. -__Make sure you run `precommit` before every commit!__ + +__Make sure you run `pre-commit` before every commit!__ + ### Checks & Testing diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..00fde4a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.7 +WORKDIR /usr/app +ADD . /usr/app +RUN python -m pip install --upgrade pip setuptools +RUN make all-install +RUN pre-commit install +# initializes all pre-commit envs +RUN pre-commit \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..48a59fb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: "3.9" + +services: + asynction: + image: asynction + volumes: + - .:/usr/app + # use the .git from the container because it + # has pre-commit setup + - /usr/app/.git/hooks + build: . + entrypoint: bash +