]> git.proxmox.com Git - mirror_qemu.git/blame - python/Makefile
meson: require 0.63.0
[mirror_qemu.git] / python / Makefile
CommitLineData
2c24d52d 1QEMU_VENV_DIR=.dev-venv
6832189f 2QEMU_MINVENV_DIR=.min-venv
6f651a6d 3QEMU_TOX_EXTRA_ARGS ?=
2c24d52d 4
205d7219 5.PHONY: help
6560379f
JS
6help:
7 @echo "python packaging help:"
8 @echo ""
6832189f
JS
9 @echo "make check-minreqs:"
10 @echo " Run tests in the minreqs virtual environment."
6f84d726 11 @echo " These tests use the oldest dependencies."
5591b745
PB
12 @echo " Requires: Python 3.7"
13 @echo " Hint (Fedora): 'sudo dnf install python3.7'"
6560379f 14 @echo ""
8c95d0fc
JS
15 @echo "make check-tox:"
16 @echo " Run tests against multiple python versions."
17 @echo " These tests use the newest dependencies."
5591b745
PB
18 @echo " Requires: Python 3.7 - 3.11, and tox."
19 @echo " Hint (Fedora): 'sudo dnf install python3-tox python3.11'"
6f651a6d
WSM
20 @echo " The variable QEMU_TOX_EXTRA_ARGS can be use to pass extra"
21 @echo " arguments to tox".
8c95d0fc 22 @echo ""
2c24d52d
JS
23 @echo "make check-dev:"
24 @echo " Run tests in a venv against your default python3 version."
25 @echo " These tests use the newest dependencies."
26 @echo " Requires: Python 3.x"
27 @echo ""
28cd32fb
JS
28 @echo "make check:"
29 @echo " Run tests in your *current environment*."
30 @echo " Performs no environment setup of any kind."
31 @echo ""
32 @echo "make develop:"
7a21bee2 33 @echo " Install deps needed for 'make check',"
28cd32fb
JS
34 @echo " and install the qemu package in editable mode."
35 @echo " (Can be used in or outside of a venv.)"
6560379f 36 @echo ""
6832189f
JS
37 @echo "make min-venv"
38 @echo " Creates the minreqs virtual environment ($(QEMU_MINVENV_DIR))"
6f84d726 39 @echo ""
2c24d52d
JS
40 @echo "make dev-venv"
41 @echo " Creates a simple venv for check-dev. ($(QEMU_VENV_DIR))"
42 @echo ""
50d0fba8
JS
43 @echo "make clean:"
44 @echo " Remove package build output."
6560379f 45 @echo ""
50d0fba8 46 @echo "make distclean:"
6832189f 47 @echo " remove venv files, qemu package forwarder,"
50d0fba8
JS
48 @echo " built distribution files, and everything from 'make clean'."
49 @echo ""
50 @echo -e "Have a nice day ^_^\n"
6560379f 51
6832189f
JS
52.PHONY: pipenv check-pipenv
53pipenv check-pipenv:
54 @echo "pipenv was dropped; try 'make check-minreqs' or 'make min-venv'"
55 @exit 1
56
0b15c42b 57PIP_INSTALL = pip install --disable-pip-version-check
6832189f
JS
58.PHONY: min-venv
59min-venv: $(QEMU_MINVENV_DIR) $(QEMU_MINVENV_DIR)/bin/activate
60$(QEMU_MINVENV_DIR) $(QEMU_MINVENV_DIR)/bin/activate: setup.cfg tests/minreqs.txt
61 @echo "VENV $(QEMU_MINVENV_DIR)"
5591b745 62 @python3.7 -m venv $(QEMU_MINVENV_DIR)
6832189f
JS
63 @( \
64 echo "ACTIVATE $(QEMU_MINVENV_DIR)"; \
65 . $(QEMU_MINVENV_DIR)/bin/activate; \
0b15c42b
PB
66 echo "INSTALL wheel $(QEMU_MINVENV_DIR)"; \
67 $(PIP_INSTALL) wheel 1>/dev/null; \
6832189f 68 echo "INSTALL -r tests/minreqs.txt $(QEMU_MINVENV_DIR)";\
0b15c42b 69 $(PIP_INSTALL) -r tests/minreqs.txt 1>/dev/null; \
6832189f 70 echo "INSTALL -e qemu $(QEMU_MINVENV_DIR)"; \
0b15c42b 71 $(PIP_INSTALL) -e . 1>/dev/null; \
6832189f
JS
72 )
73 @touch $(QEMU_MINVENV_DIR)
6560379f 74
6832189f
JS
75.PHONY: check-minreqs
76check-minreqs: min-venv
77 @( \
78 echo "ACTIVATE $(QEMU_MINVENV_DIR)"; \
79 . $(QEMU_MINVENV_DIR)/bin/activate; \
80 make check; \
81 )
6560379f 82
2c24d52d
JS
83.PHONY: dev-venv
84dev-venv: $(QEMU_VENV_DIR) $(QEMU_VENV_DIR)/bin/activate
85$(QEMU_VENV_DIR) $(QEMU_VENV_DIR)/bin/activate: setup.cfg
86 @echo "VENV $(QEMU_VENV_DIR)"
87 @python3 -m venv $(QEMU_VENV_DIR)
88 @( \
89 echo "ACTIVATE $(QEMU_VENV_DIR)"; \
90 . $(QEMU_VENV_DIR)/bin/activate; \
91 echo "INSTALL qemu[devel] $(QEMU_VENV_DIR)"; \
92 make develop 1>/dev/null; \
93 )
94 @touch $(QEMU_VENV_DIR)
95
96.PHONY: check-dev
97check-dev: dev-venv
98 @( \
99 echo "ACTIVATE $(QEMU_VENV_DIR)"; \
100 . $(QEMU_VENV_DIR)/bin/activate; \
101 make check; \
102 )
103
205d7219 104.PHONY: develop
6560379f 105develop:
0b15c42b 106 $(PIP_INSTALL) -e .[devel]
6560379f 107
205d7219 108.PHONY: check
6560379f
JS
109check:
110 @avocado --config avocado.cfg run tests/
111
205d7219 112.PHONY: check-tox
3c8de38c 113check-tox:
6f651a6d 114 @tox $(QEMU_TOX_EXTRA_ARGS)
3c8de38c 115
a4ffaecd
JS
116.PHONY: check-coverage
117check-coverage:
118 @coverage run -m avocado --config avocado.cfg run tests/*.py
119 @coverage combine
120 @coverage html
121 @coverage report
122
205d7219 123.PHONY: clean
6560379f
JS
124clean:
125 python3 setup.py clean --all
19cf0031 126 rm -f pyproject.toml
6560379f 127
205d7219 128.PHONY: distclean
6560379f 129distclean: clean
6832189f
JS
130 rm -rf qemu.egg-info/ .eggs/ dist/
131 rm -rf $(QEMU_VENV_DIR) $(QEMU_MINVENV_DIR) .tox/
a4ffaecd
JS
132 rm -f .coverage .coverage.*
133 rm -rf htmlcov/