- Python 3.8+. You can use pyenv to install multiple versions of Python in parallel.
An env file is required to use analyses via GitHub webhook.
cp .env_template .env
- Set variables in .env file
To start the API, follow these instructions:
git clone https://github.com/tioborto/raddar.git
cd raddar
- Create and activate virtualenv (eg.
poetry shell
) - Install the requirements for both prod and dev:
poetry install
- Run
uvicorn raddar.main:app
(--reload
for development) - Install git hooks:
pre-commit install --install-hooks
A Dockerfile and a docker-compose file are present in this repository.
To launch the app using docker, just follow these instructions :
$ docker-compose build
$ docker-compose up -d
To check the logs, run:
docker-compose logs
The API will be accessible at the same URLs as above.
In local mode or using the docker image, a mini web server is launched in your terminal session and the API is accessible at the following URLs:
- Docs : http://localhost:8000/docs
- Redoc: http://localhost:8000/redoc
- API: http://localhost:8000/api/v1
- PgAdmin: http://localhost:5050
- Flower: http://localhost:5555
Code formatting is automated using Black. Simply run black .
to format your code.
Before every commit, pre-commit hooks are run to:
- check code formatting
- detect secrets
- create TOC in README
If your commit is prevented by black, that means that code was reformatted. Just try your commit again and it should pass.
If it was prevented by markdown-toc, that means the TOC was regenerated. git add
the modified README and commit again.
Please open a Pull Request per User Story, with a commit per subtask, or a Pull Request per subtask.
Please try to follow Conventional Commits for your commits, e.g:
feat: list GitHub users
OKfix: use new Vault authentication in GitLab CI
OKfix : stuff
NOT OK (space before colon + vague message)change: list GitHub users
NOT OK (change
keyword not in allowed list)feat: List GitHub users
NOT OK (message should not start with a capital letter, e.g notList
)- more examples are available in the Conventional Commits documentation
Allowed keywords for commits are build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test
.
You can use commitizen to help you choose the type of commit and write your messages.
Please test your code, and make sure that code coverage doesn't decrease.
Please type hint your code, or add types to the code you change.
Raddar is available under the MIT license.