forked from kmatarese/glide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (48 loc) · 1.35 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
ENV := $(HOME)/env/glide
TEST_ENV := /tmp/glide_pip_test/
PACKAGE_NAME := 'glide'
VERSION := $(shell python setup.py --version)
EGG_OPTIONS := egg_info
PIP_CMD := $(ENV)/bin/pip
SETUP_CMD := $(ENV)/bin/python setup.py
all: install
clean:
rm -rf build dist *.egg-info
develop:
$(PIP_CMD) install -U -e ./ --no-binary ":all:"
install:
$(SETUP_CMD) bdist_wheel $(EGG_OPTIONS)
$(PIP_CMD) install -U dist/$(PACKAGE_NAME)-$(VERSION)-py3-none-any.whl
uninstall:
if ($(PIP_CMD) freeze 2>&1 | grep $(PACKAGE_NAME)); \
then $(PIP_CMD) uninstall $(PACKAGE_NAME) --yes; \
else \
echo 'No installed package found!'; \
fi
dist:
$(MAKE) clean
$(SETUP_CMD) sdist bdist_wheel
upload:
$(ENV)/bin/python -m twine upload dist/*
test_upload:
$(ENV)/bin/python -m twine upload --repository-url "https://test.pypi.org/legacy/" dist/*
test_env:
rm -rf $(TEST_ENV)
mkdir $(TEST_ENV)
$(ENV)/bin/python -m venv $(TEST_ENV)
$(TEST_ENV)/bin/pip install -U pip
pip:
$(MAKE) dist
$(MAKE) upload
$(MAKE) test_env
sleep 30
$(TEST_ENV)/bin/pip install -U glide==$(VERSION)
$(TEST_ENV)/bin/python -c "import glide"
test_pip:
$(MAKE) dist
$(MAKE) test_upload
$(MAKE) test_env
sleep 30
$(TEST_ENV)/bin/pip install -i "https://test.pypi.org/simple/" --extra-index-url "https://pypi.org/simple/" glide==$(VERSION)
$(TEST_ENV)/bin/python -c "import glide"
.PHONY: dist clean test_env