File: Makefile

package info (click to toggle)
python-podman 5.4.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,140 kB
  • sloc: python: 7,532; makefile: 82; sh: 75
file content (122 lines) | stat: -rw-r--r-- 3,598 bytes parent folder | download | duplicates (3)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
export GO111MODULE=off
export GOPROXY=https://proxy.golang.org


PYTHON ?= $(shell command -v python3 2>/dev/null || command -v python || which python3)
DESTDIR ?= /
DESTDIR ?=
EPOCH_TEST_COMMIT ?= $(shell git merge-base $${DEST_BRANCH:-main} HEAD)
HEAD ?= HEAD

export PODMAN_VERSION ?= "5.4.0"

.PHONY: podman
podman:
	rm dist/* || :
	$(PYTHON) -m pip install -q build
	PODMAN_VERSION=$(PODMAN_VERSION) \
	$(PYTHON) -m build

.PHONY: lint
lint: tox
	$(PYTHON) -m tox -e format,lint

.PHONY: tests
tests: tox
	# see tox.ini for environment variable settings
	$(PYTHON) -m tox -e coverage,py39,py310,py311,py312,py313

.PHONY: tests-ci-base-python
tests-ci-base-python:
	$(PYTHON) -m tox -e coverage,py

.PHONY: tests-ci-all-python
tests-ci-all-python:
	$(PYTHON) -m tox -e coverage,py39,py310,py311,py312,py313

.PHONY: unittest
unittest:
	coverage run -m unittest discover -s podman/tests/unit
	coverage report -m --skip-covered --fail-under=80 --omit=./podman/tests/* --omit=.tox/* --omit=/usr/lib/*

.PHONY: integration
integration:
	coverage run -m unittest discover -s podman/tests/integration
	coverage report -m --skip-covered --fail-under=80 --omit=./podman/tests/* --omit=.tox/* --omit=/usr/lib/*

.PHONY: tox
tox:
ifeq (, $(shell which dnf))
	brew install python@3.9 python@3.10 python@3.11 python@3.12 python@3.13
else
	-dnf install -y python3 python3.9 python3.10 python3.11 python3.12 python3.13
endif
	# ensure tox is available. It will take care of other testing requirements
	$(PYTHON) -m pip install --user tox

.PHONY: test-release
test-release: SOURCE = $(shell find dist -regex '.*/podman-[0-9][0-9\.]*.tar.gz' -print)
test-release:
	twine upload --verbose -r testpypi dist/*whl $(SOURCE)
	# pip install -i https://test.pypi.org/simple/ podman

.PHONY: release
release: SOURCE = $(shell find dist -regex '.*/podman-[0-9][0-9\.]*.tar.gz' -print)
release:
	twine upload --verbose dist/*whl $(SOURCE)
	# pip install podman

.PHONY: docs
docs:
	sphinx-apidoc --separate --no-toc --force --templatedir docs/source/_templates/apidoc \
		-o docs/source/ podman podman/tests

	# HARD CODED COMMAND from readthedocs! We must conform!
	# -T : traceback
	# -E : do not use saved environment, always read all files
	# -W : warnings reported as errors then --keep-going when getting warnings
	# -b html : build html
	# -d : path for cached environment and doctree files
	# -D language=en : define language as en
	# . : source directory
	# _build/html : target
	cd docs/source && python3 -m sphinx -T -E -W --keep-going -b html -d _build/doctrees -D language=en . _build/html

.PHONY: rpm
rpm: ## Build rpm packages
	rpkg local

# .PHONY: install
HEAD ?= HEAD
# install:
# 	$(PYTHON) setup.py install --root ${DESTDIR}

# .PHONY: upload
# upload: clean
# 	PODMAN_VERSION=$(PODMAN_VERSION) $(PYTHON) setup.py sdist bdist_wheel
# 	twine check dist/*
# 	twine upload --verbose dist/*
# 	twine upload --verbose dist/*

.PHONY: clobber
clobber: uninstall clean

.PHONY: uninstall
uninstall:
	$(PYTHON) -m pip uninstall --yes podman ||:

.PHONY: clean
clean:
	rm -rf podman_py.egg-info dist build/*
	find . -depth -name __pycache__ -exec rm -rf {} \;
	find . -depth -name \*.pyc -exec rm -f {} \;
	$(PYTHON) ./setup.py clean --all

.PHONY: validate
validate: .gitvalidation lint

.PHONY: .gitvalidation
.gitvalidation:
	# I have no great ideas on how to install/check for git-validation
	@echo "Validating vs commit '$(call err_if_empty,EPOCH_TEST_COMMIT)'"
	GIT_CHECK_EXCLUDE="./vendor:docs/make.bat" git-validation -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..$(HEAD)