-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (44 loc) · 1.17 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
#* Variables
SHELL := /usr/bin/env bash
PYTHON := python3
#* Directories with source code
CODE = config broadcast signup
#* Include environment variables if .env exists
ifneq ("$(wildcard .env)","")
include .env
export
endif
#* Poetry
.PHONY: poetry-download
poetry-download:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | $(PYTHON) -
#* Installation
.PHONY: install
install:
poetry install -n
poetry run mypy --install-types --non-interactive $(CODE)
pre-commit install
.PHONY: check-mypy
check-mypy:
mypy --config-file pyproject.toml $(CODE)
#* Formatters
.PHONY: codestyle
codestyle:
pyupgrade --exit-zero-even-if-changed --py39-plus **/*.py
autoflake --recursive --in-place --remove-all-unused-imports --ignore-init-module-imports $(CODE)
isort --settings-path pyproject.toml $(CODE)
black --config pyproject.toml $(CODE)
.PHONY: export-requirements
export-requirements:
poetry export -f requirements.txt --output requirements.txt --without dev
.PHONY: shell
shell:
poetry run ptipython --vi
#* Broadcast
.PHONY: broadcast
broadcast:
poetry run python3 -m broadcast
#* Signup
.PHONY: signup
signup:
poetry run python3 -m signup