-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 1.03 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
VENV := .venv
VENV_SENTINEL := $(VENV)/.sentinel
VENV_PYTHON := $(VENV)/bin/python
VENV_PIP := $(VENV)/bin/pip
.PHONY: ensure_out_of_venv
ensure_out_of_venv:
ifdef VIRTUAL_ENV
$(error "Please deactivate your virtual environment")
endif
.PHONY: $(VENV)
$(VENV):
$(MAKE) $(VENV_SENTINEL)
.PHONY: clean_venv
clean_venv: ensure_out_of_venv
rm -rf $(VENV)
python3 -m venv $(VENV)
$(VENV_PIP) install --upgrade pip wheel
$(VENV_SENTINEL): requirements.txt
$(MAKE) clean_venv
$(VENV_PIP) install -r $^
touch $(VENV_SENTINEL)
.PHONY: update_requirements
update_requirements: requirements-loose.txt
$(MAKE) clean_venv
$(VENV_PIP) install -r $^
$(VENV_PIP) freeze > requirements.txt
$(MAKE) $(VENV)
.PHONY: install
install: $(VENV)
ln -fs $(realpath $(PWD)) $(HOME)/sync_gh_keys
mkdir -p $(HOME)/.config/systemd/user/
install -m0644 sync-gh-keys.service sync-gh-keys.timer $(HOME)/.config/systemd/user/
systemctl --user enable --now sync-gh-keys.timer
echo "Make sure to add SYNC_GH_USERS to ~/.config/environment.d/sync_gh_users.conf !"