forked from ELTE-DH/WebArticleCurator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (34 loc) · 1.13 KB
/
Makefile
File metadata and controls
41 lines (34 loc) · 1.13 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
37
38
39
40
41
.DEFAULT_GOAL = all
RED := $(shell tput setaf 1)
GREEN := $(shell tput setaf 2)
NOCOLOR := $(shell tput sgr0)
PYTHON := python3
VENVDIR := $(CURDIR)/venv
VENVPIP := $(VENVDIR)/bin/python -m pip
VENVPYTHON := $(VENVDIR)/bin/python
all:
@echo "See Makefile for possible targets!"
venv:
@echo "Creating virtualenv in $(VENVDIR)...$(NOCOLOR)"
@rm -rf $(VENVDIR)
@$(PYTHON) -m venv $(VENVDIR)
@$(VENVPIP) install wheel twine
@$(VENVPIP) install -r requirements.txt
@echo "$(GREEN)Virtualenv is successfully created!$(NOCOLOR)"
.PHONY: venv
build:
$(VENVPYTHON) setup.py sdist bdist_wheel
install: build
@echo "Installing package to user..."
$(VENVPIP) install --upgrade dist/*.whl
@echo "$(GREEN)Package is successfully installed!$(NOCOLOR)"
.PHONY: install
upload:
$(VENVPYTHON) -m twine upload dist/*
clean:
rm -rf dist/ build/ webarticlecurator.egg-info/
test:
for i in configs/config_*.yaml; do echo "Testing $${i}:"; $(VENVPYTHON) webarticlecurator/utils.py $${i} \
|| exit 1; done
for i in configs/extractors/site_specific_*.py; do $(VENVPYTHON) $${i} || exit 1; done
@echo "$(GREEN)All tests are successfully passed!$(NOCOLOR)"