-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 1 KB
/
Makefile
File metadata and controls
36 lines (29 loc) · 1 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
PYTHON3=/usr/bin/python3
BUILD_DIR=build
DIST_DIR=dist
VIRTUALENV=$(BUILD_DIR)/_virtualenv
VIRTUALENV_BIN=$(VIRTUALENV)/bin
ACTIVATE=$(VIRTUALENV_BIN)/activate
.PHONY: clean test
clean:
rm -rf $(BUILD_DIR) $(DIST_DIR)
# TODO: linting this way is broken anyway
# lint: $(ACTIVATE)
# $(VIRTUALENV_BIN)/python setup.py flake8
test: $(ACTIVATE)
$(VIRTUALENV_BIN)/python -m unittest discover -v
build-dist: clean $(ACTIVATE) test
$(VIRTUALENV_BIN)/python setup.py sdist bdist_wheel
publish-dist: build-dist
$(VIRTUALENV_BIN)/pip install twine==5.0.0 && \
$(VIRTUALENV_BIN)/twine upload dist/*
$(VIRTUALENV) $(ACTIVATE):
@command -v virtualenv >/dev/null 2>&1 || { echo >&2 "This build requires virtualenv to be installed. Aborting."; exit 1; }
@mkdir -p $(BUILD_DIR)
@if [ -d $(VIRTUALENV) ]; then \
echo "Existing virtualenv found. Skipping virtualenv creation."; \
else \
echo "Creating virtualenv at $(VIRTUALENV)"; \
virtualenv $(VIRTUALENV) --python=$(PYTHON3); \
fi
. $(ACTIVATE) && pip install .