-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (60 loc) · 2.32 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
# This is needed so local copy of dependencies supercede the installed ones.
BASIC_PATH=src:../dls-logformatter/src
PYTHONPATH=$(BASIC_PATH)
# ------------------------------------------------------------------
# Tests individually.
test:
PYTHONPATH=tests:$(PYTHONPATH) \
python3 -m pytest -sv -ra --tb=line tests/$(t)
test-01-simple:
PYTHONPATH=$(PYTHONPATH) python3 -m pytest -sv -ra --tb=line tests/test_01_simple.py
test-02-subcommand:
PYTHONPATH=$(PYTHONPATH) python3 -m pytest -sv -ra --tb=line tests/test_02_subcommand.py
test-03-default_subcommand:
PYTHONPATH=$(PYTHONPATH) python3 -m pytest -sv -ra --tb=line tests/test_03_default_subcommand.py
test-04-rotating:
PYTHONPATH=$(PYTHONPATH) python3 -m pytest -sv -ra --tb=line tests/test_04_rotating.py
test-05-duplicate:
PYTHONPATH=$(PYTHONPATH) python3 -m pytest -sv -ra --tb=line tests/test_05_duplicate.py
# ------------------------------------------------------------------
# These targets are hit by scisof-bxflow-templates/gitlab-ci-template.yml.
# The template provides environment variables:
# - PYTHON_VERSION
# - PIP_TARGET
# - SECRET_GITLAB_READ_REPOSITORY_TOKEN
pytest:
PYTHONPATH=$(PYTHONPATH) pytest
install-dependency:
pip install \
--no-deps \
--python-version $(PYTHON_VERSION) \
--target $(PIP_TARGET) \
--upgrade git+https://$(SECRET_GITLAB_READ_REPOSITORY_TOKEN)@gitlab.diamond.ac.uk/scisoft/bxflow/$(project).git && \
rm -rf build
install-dependencies:
make install-dependency project=dls-logformatter
# ------------------------------------------------------------------
# Utility.
tree:
tree -I "__*" dls_mainiac_lib
tree -I "__*" tests
.PHONY: list
list:
@awk "/^[^\t:]+[:]/" Makefile | grep -v ".PHONY"
clean:
find . -name '*.pyc' -exec rm -f {} \;
find . -name '__pycache__' -exec rm -rf {} \;
show-version:
PYTHONPATH=$(PYTHONPATH) python3 -m dls_mainiac_lib.version --json
PYTHONPATH=$(PYTHONPATH) python3 -m dls_mainiac_lib.version
# ------------------------------------------------------------------
# Version bumping. Configured in setup.cfg.
# Thanks: https://pypi.org/project/bump2version/
bump-patch:
bump2version --list patch
bump-minor:
bump2version --list minor
bump-major:
bump2version --list major
bump-dryrun:
bump2version --dry-run patch