/
Makefile
56 lines (45 loc) · 1.24 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
.PHONE: help install uninstall build distribute clean
PROJECT_NAME := "awsamigo"
ifdef PYPI_REPO
export TWINE_OPTS = --repository=$(PYPI_REPO)
else
export TWINE_OPTS = ""
endif
ifndef VIRTUAL_ENV
$(error You are not inside a Python virtualenv!)
endif
export TWINE = $(shell which twine)
help:
@echo
@echo "Available targets:"
@echo " install - Install $(PROJECT_NAME)"
@echo " uninstall - Uninstall $(PROJECT_NAME)"
@echo " build - Build source distribution for $(PROJECT_NAME)."
@echo " distribute - Upload source distribution to PyPi via TWINE."
@echo
install:
pip install -e .[dev]
uninstall:
pip uninstall -y blunix_toolkit
build:
python setup.py sdist
distribute: clean build
if [[ -z $(PYPI_REPO) ]]; then echo "PYPI_REPO is not defined!"; fi
$(TWINE) upload dist/* $(TWINE_OPTS)
release:
@git status
@echo
@echo "Current version is: $(shell git describe)"
@read -p "What's the new version? " new_version; \
if [[ -n "$$new_version" ]]; then \
git tag -s -a "$$new_version"; \
if [[ $$? -eq 0 ]]; then \
echo git push && \
echo git push --tags && \
echo PYPI_REPO=baccenfutter $(MAKE) clean build distribute; \
fi; \
fi
clean:
rm -rf *.egg-info
rm -rf build/ dist/ MANIFEST
find -name \*.pyc -delete