-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
44 lines (38 loc) · 1.04 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
PROJ_BASE=$(shell pwd)
PYTHONVENV=$(PROJ_BASE)/venv
ifeq ($(OS),Windows_NT)
VENVPYTHON=$(PYTHONVENV)/Scripts/python
else
VENVPYTHON=$(PYTHONVENV)/bin/python
endif
PHONY: init
init:
@echo "Creating virtual environment 'venv'."
python3 -m venv venv || python -m venv venv
$(VENVPYTHON) -m pip install --upgrade setuptools pip
PHONY: develop
develop: init
@echo "Installing wktplot, with editible modules ('python -m pip install --editable .[test]')"
$(VENVPYTHON) -m pip install --editable .[test]
PHONY: build
build:
$(VENVPYTHON) -m pip install build
$(VENVPYTHON) -m build --wheel
PHONY: clean
clean:
@echo "Removing build artifacts"
rm -rf $(PROJ_BASE)/build
rm -rf $(PROJ_BASE)/dist
rm -rf $(PROJ_BASE)/src/*.egg-info
rm -rf $(PROJ_BASE)/docs/_build/*
rm -f $(PROJ_BASE)/coverage.xml
rm -f $(PROJ_BASE)/.coverage
find $(PROJ_BASE)/examples -type f ! -name '*.py' -delete
PHONY: sparkling
sparkling: clean
rm -rf $(PROJ_BASE)/venv*
rm -rf $(PROJ_BASE)/.pytest_cache
PHONY: test
test:
$(VENVPYTHON) -m pytest
$(VENVPYTHON) -m flake8 .