Centralize project commands to a Makefile
This commit is contained in:
parent
aa9aaad78c
commit
2f0f67d15a
3 changed files with 47 additions and 8 deletions
39
Makefile
Normal file
39
Makefile
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
.PHONY: \
|
||||
clean \
|
||||
check_code_format \
|
||||
format_code \
|
||||
generate_requirements_file \
|
||||
install \
|
||||
install_dev \
|
||||
lint \
|
||||
run \
|
||||
test
|
||||
|
||||
clean:
|
||||
# https://stackoverflow.com/a/41386937/162086
|
||||
python3 -Bc "for p in __import__('pathlib').Path('.').rglob('*.py[co]'): p.unlink()"; \
|
||||
python3 -Bc "for p in __import__('pathlib').Path('.').rglob('__pycache__'): p.rmdir()"
|
||||
|
||||
check_code_format:
|
||||
python3 -m black --target-version=py36 --diff .
|
||||
|
||||
format_code:
|
||||
python3 -m black --target-version=py36 .
|
||||
|
||||
generate_requirements_file:
|
||||
python3 -m piptools compile --output-file=requirements.txt
|
||||
|
||||
install:
|
||||
python3 -m pip install -r requirements.txt
|
||||
|
||||
install_dev:
|
||||
python3 -m pip install -e ".[dev]"
|
||||
|
||||
lint:
|
||||
python3 -m flake8
|
||||
|
||||
run:
|
||||
python3 ./manage.py runserver --ipv6
|
||||
|
||||
test:
|
||||
python3 ./manage.py test
|
||||
Loading…
Add table
Add a link
Reference in a new issue