-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMakefile
67 lines (38 loc) · 1.46 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
61
62
63
64
65
66
67
# Customize creation by defining the environment variables PYTHON and/or VENV
# Virtualenv to install in. In this order:
# 1. the one given by the VENV environment variable
# 2. an active one (as given by the VIRTUAL_ENV environment variable)
# 3. a default
VENV ?= $(shell echo $${VIRTUAL_ENV:-/opt/venv/dps})
# Python executable to create the virtualenv with
PYTHON ?= python3
# --------------------------------------------------------------------------
# Package version: taken from the __init__.py file
VERSION_FILE := dps/spark_df/__init__.py
VERSION := $(shell grep "VERSION =" $(VERSION_FILE) | sed -r "s/^VERSION\s*=\s*\"(.*)\"/\1/")
# Package name
NAME := dps
PKGFILE := dist/$(NAME)-$(VERSION).tar.gz
VENV_PYTHON ?= $(VENV)/bin/python3
# --------------------------------------------------------------------------
all:
@echo "VERSION = $(VERSION)"
@echo "VIRTUALENV = $(VENV)"
@echo "use 'make pkg' to build the package"
@echo "use 'make install' to install the package into $(VENV)"
build pkg: $(PKGFILE)
clean:
rm -f "$(PKGFILE)"
rebuild: clean build
version:
@echo "$(VERSION)"
install: $(VENV) $(PKGFILE)
$(VENV)/bin/pip install $(PKGFILE)
reinstall: $(VENV) rebuild install
# --------------------------------------------------------------------------
$(PKGFILE): $(VENV) $(VERSION_FILE) setup.py requirements-df.txt
$(VENV_PYTHON) setup.py sdist
$(VENV):
mkdir -p $@
$(PYTHON) -m venv $@
$@/bin/pip install --upgrade pip wheel