forked from dolph/rtox
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
34 lines (27 loc) · 963 Bytes
/
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
all: test dist
.PHONY: all upload info dist
PACKAGE_NAME := $(shell python setup.py --name)
PACKAGE_VERSION := $(shell python setup.py --version)
PYTHON_PATH := $(shell which python)
PLATFORM := $(shell uname -s | awk '{print tolower($$0)}')
DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PYTHON_VERSION := $(shell python3 -c "import sys; print('py%s%s' % sys.version_info[0:2] + ('-conda' if 'conda' in sys.version or 'Continuum' in sys.version else ''))")
PREFIX=
ifndef GIT_BRANCH
GIT_BRANCH=$(shell git branch | sed -n '/\* /s///p')
endif
info:
@echo "INFO: Building $(PACKAGE_NAME):$(PACKAGE_VERSION) on $(GIT_BRANCH) branch"
@echo "INFO: Python $(PYTHON_VERSION) from '$(PREFIX)' [$(CONDA)]"
clean:
@find . -name "*.pyc" -delete
@rm -rf .tox dist/* docs/build/*
test:
@tox
uninstall:
$(PREFIX)pip uninstall -y $(PACKAGE_NAME)
dist:
@rm -rf dist/*
$(PREFIX)python setup.py sdist bdist_wheel
upload: dist
twine upload dist/*