-
Notifications
You must be signed in to change notification settings - Fork 2
/
justfile
89 lines (65 loc) · 1.81 KB
/
justfile
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
84
85
86
87
88
89
# Just is a crossplatform task-runner, similar to make.
# And justfiles are equivalent to makefiles.
#
# Official docs:
# - https://just.systems/man/en
#
# Usage:
# > just --help
# > just <taskname>
#
# Notes:
# - Comments immediately preceding a recipe will appear in just --list:
# load environment variables from .env file
set dotenv-filename := ".env"
set dotenv-load := true
# Help target
help:
@ just --list --unsorted
# create directiries
ensure-dirs:
@ mkdir -p var/cache
@ mkdir -p var/log
@ mkdir -p var/run
@ mkdir -p var/static
@ mkdir -p var/tmp
# full initial pythondev-installation
install: ensure-dirs create-venv symlink-venv-dirs upgrade-pip poetry-install
# create python39 virtual-environment
create-venv:
PYENV_VERSION=3.9 python -m venv .venv
# symlink venv-dirs to make bin/python work
symlink-venv-dirs:
@ ln -sf .venv/bin
@ ln -sf .venv/lib
@ ln -sf .venv/pyvenv.cfg
# symlink ipython to ip
symlink-ipython:
@ cd .venv/bin && ln -sf ipython ip
# upgrade pip itself
upgrade-pip:
bin/pip install -U pip
# run poetry install
poetry-install:
poetry install
# update poetry.lock
poetry-lock:
poetry lock
# show packages
poetry-show:
poetry show
# show outdated packages
poetry-show-outdated:
poetry show --outdated
# export poetry-defined requirements to a pip-installable requirements-file
[linux]
poetry-export-requirements:
@ poetry lock
@ poetry export -f requirements.txt --output etc/requirements.txt
@ cat etc/requirements-header.txt <(echo "") etc/requirements.txt > etc/temp.txt && mv etc/temp.txt etc/requirements.txt
@ cp etc/requirements.txt requirements.txt
@ echo -e "Updated etc/requirements.txt"
# switch to staging-branch and git pull to update
update-staging:
git co staging
git pull