-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
86 lines (63 loc) · 1.76 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# (C) Copyright 2015-2025 Dassault Systemes SE. All Rights Reserved.
#
# This software is licensed under a BSD 3-Clause License.
# See the LICENSE file provided with this software.
PYTHON_VERSION ?= 3
PYTHON ?= python$(PYTHON_VERSION)
PIP ?= pip$(PYTHON_VERSION)
VIRTUALENV ?= virtualenv
MYPY ?= mypy
PYLINT ?= pylint
MKDIR ?= mkdir -p
RMDIR ?= rm -rf
TMPDIR ?= ./.testtemp
VIRTDIR ?= ./.virttemp
ARTIFACTDIR ?= artifacts
RESULTSDIR ?= results
PYTEST ?= pytest
PYTEST_ARGS ?=
PYTEST_LOG ?= --show-capture=stdout --log-file=$(ARTIFACTDIR)/testlog.out --log-file-level=INFO
PYTEST_OPTS ?= --junitxml=$(RESULTSDIR)/result.xml
PYTEST_COV ?= --cov=pynuodb --cov-report=html:$(ARTIFACTDIR) --cov-report=term-missing
SUDO ?= sudo -n
NUODB_HOME ?= /opt/nuodb
_INSTALL_CMD = $(PIP) install '.[crypto]'
_VERIFY_CMD = $(NUODB_HOME)/bin/nuocmd show domain
_PYTEST_CMD = $(MKDIR) $(ARTIFACTDIR) $(RESULTSDIR) \
&& TMPDIR='$(TMPDIR)' PATH="$(NUODB_HOME)/bin:$$PATH" \
$(PYTEST) $(PYTEST_LOG) $(PYTEST_OPTS) $(PYTEST_ARGS)
all:
$(MAKE) install
$(MAKE) test
install:
$(_INSTALL_CMD)
check: mypy pylint fulltest
fulltest:
$(_INSTALL_CMD)
$(PIP) install -r test_requirements.txt
$(_VERIFY_CMD)
$(_PYTEST_CMD)
test:
$(_PYTEST_CMD)
test-coverage:
$(_PYTEST_CMD) $(PYTEST_COV)
verify:
$(_VERIFY_CMD)
mypy:
$(MYPY) --ignore-missing-imports pynuodb
pylint:
$(PYLINT) --rcfile=.pylint-rc pynuodb
virtual-%:
$(RMDIR) '$(VIRTDIR)'
$(VIRTUALENV) -p $(PYTHON) '$(VIRTDIR)'
. '$(VIRTDIR)/bin/activate' && $(MAKE) '$*'
deploy:
$(PYTHON) setup.py register
$(PYTHON) setup.py sdist upload
clean:
$(RMDIR) build/ dist/ *.egg-info htmlcov/
doc:
$(PIP) install epydoc
epydoc --html --name PyNuoDB pynuodb/
cp epydoc.css html/
.PHONY: all install check fulltest test verify deploy clean doc