-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (37 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
45 lines (37 loc) · 1.12 KB
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
PROJECT=$(shell python3 setup.py --name)
PROJECT_VERSION=$(shell python3 setup.py --version)
SOURCEDIR=$(subst -,_,$(PROJECT))
SOURCES=$(shell find $(SOURCEDIR) -name '*.py')
APP_SERVER=ea-app
.PHONY: venv build install develop clean test
venv:
@if [ ! -d ".venv" ]; then \
python3 -m venv .venv && \
. .venv/bin/activate && \
pip3 install -q -U pip && \
pip3 install -q -r requirements.txt;\
fi
build: venv
. .venv/bin/activate && \
python3 setup.py build
install:
python3 setup.py install
deploy:
python3 setup.py sdist bdist_wheel
scp dist/$(PROJECT)-$(PROJECT_VERSION)-py3-none-any.whl $(APP_SERVER):
ssh $(APP_SERVER) /usr/local/bin/pip3 install -q -U $(PROJECT)-$(PROJECT_VERSION)-py3-none-any.whl
develop: venv
. .venv/bin/activate && \
pip3 install -q -U -r requirements-dev.txt && \
python3 setup.py develop
clean:
python3 setup.py clean && \
pip3 uninstall -q -y $(PROJECT)
rm -rf *.egg-info/
rm -rf dist/ build/
find . -name '*.retry' -print | xargs rm
find . -name '*.pyc' -print | xargs rm
find . -name '__pycache__' -print | xargs rmdir
test: venv
. .venv/bin/activate && \
python3 -m pytest