forked from ShahriyarR/hexagonal-fastapi-jobboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (44 loc) · 1.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
PYTHON=./.venv/bin/python
PHONY = help install install-dev test test-cov run init-db format lint type secure
help:
@echo "---------------HELP-----------------"
@echo "To install the project type -> make install"
@echo "To install the project for development type -> make install-dev"
@echo "To run application -> make run"
@echo "To test the project type [exclude slow tests] -> make test"
@echo "To test the project [only slow tests] -> make test-slow"
@echo "To test with coverage [all tests] -> make test-cov"
@echo "To format code type -> make format"
@echo "To check linter type -> make lint"
@echo "To run type checker -> make type-check"
@echo "To run all security related commands -> make secure"
@echo "------------------------------------"
install:
${PYTHON} -m flit install --env --deps=develop
install-dev:
${PYTHON} -m flit install --env --deps=develop --symlink
format:
${PYTHON} -m isort src tests --force-single-line-imports
${PYTHON} -m autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place src --exclude=__init__.py
${PYTHON} -m black src tests --config pyproject.toml
${PYTHON} -m isort src tests
lint:
${PYTHON} -m flake8 src
${PYTHON} -m black src tests --check --diff --config pyproject.toml
${PYTHON} -m isort src tests --check --diff
run:
python -m uvicorn src.jobboard.adapters.entrypoints.application:app --host 0.0.0.0 --port 8000 --reload
migrations:
alembic -c src/jobboard/adapters/db/alembic.ini revision --autogenerate
migrate:
alembic -c src/jobboard/adapters/db/alembic.ini upgrade head
test:
TEST_RUN="TRUE" ${PYTHON} -m pytest -svvv -m "not slow" tests
test-slow:
TEST_RUN="TRUE" ${PYTHON} -m pytest -svvv -m "slow" tests
test-cov:
TEST_RUN="TRUE" ${PYTHON} -m pytest -svvv --cov-report html --cov=src tests
type:
${PYTHON} -m pytype --config=pytype.cfg src/*
secure:
${PYTHON} -m bandit -r src --config pyproject.toml