-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
83 lines (62 loc) · 2.1 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
SHELL = /bin/bash
NAME := smolparty
PYMAJOR := 3
PYREV := 10
PYPATCH := 3
PYVERSION := ${PYMAJOR}.${PYREV}.${PYPATCH}
PYENV := ~/.pyenv/versions/${PYVERSION}
VENV_NAME := ${NAME}-${PYVERSION}
VENV := ${PYENV}/envs/${VENV_NAME}
EGGLINK := ${VENV}/lib/python${PYMAJOR}.${PYREV}/site-packages/${NAME}.egg-link
BREW_SSL := /usr/local/opt/openssl@1.1
BREW_READLINE := /usr/local/opt/readline
export LDFLAGS = -L${BREW_SSL}/lib -L${BREW_READLINE}/lib
export CFLAGS = -I${BREW_SSL}/include -I${BREW_READLINE}/include
export CPPFLAGS = -I${BREW_SSL}/include -I${BREW_READLINE}/include
# delberately smash this so we keep arm64-homebrew out of our field of view
export PATH = ${VENV}/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
${BREW_READLINE}:
arch -x86_64 /usr/local/bin/brew install readline
${BREW_SSL}:
arch -x86_64 /usr/local/bin/brew install openssl@1.1
${PYENV}: ${BREW_SSL} ${BREW_READLINE}
arch -x86_64 /usr/local/bin/pyenv install ${PYVERSION}
${VENV}: ${PYENV}
arch -x86_64 /usr/local/bin/pyenv virtualenv ${PYVERSION} ${VENV_NAME}
${VENV}/bin/python -m pip install -U pip setuptools wheel
${VENV}/bin/python -m pip install -U poetry
.python-version: ${VENV}
echo ${VENV_NAME} >.python-version
${EGGLINK}: poetry.lock
PYENV_VERSION=${NAME} VIRTUAL_ENV=${VENV} ${VENV}/bin/poetry install
# an update-install might not necessarily update this
touch ${EGGLINK}
# General repo and env managements
setup: .python-version ${EGGLINK}
git submodule update --init
clean:
git clean -fdx -e '*.ipynb'
nuke:
git clean -fdx -e '*.ipynb'
rm -f .python-version
/usr/local/bin/pyenv uninstall -f ${PYVERSION}
# Django
makemigrate:
poetry run python manage.py makemigrations && poetry run python manage.py makemigrations events
migrate:
poetry run python manage.py migrate
collectstatic:
poetry run python manage.py collectstatic
createsuperuser:
poetry run python manage.py createsuperuser
runserver:
poetry run python manage.py runserver
up: runserver
# Formatting
format:
poetry run black .
poetry run isort .
poetry run djlint . --reformat
# Linting
lint:
poetry run python ./run_linters.py