-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.mk
38 lines (31 loc) · 943 Bytes
/
package.mk
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
#
# Create Python package
#
# One of the packages required for packaging controls
# installation of all build requirements (pars pro toto).
VENV_PACKAGING=$(DIR_VENV_SITE_PACKAGES)/build
# Package is rebuilt, when one of these dependencies change:
PKG_DEP += $(VENV_PACKAGING)
PKG_DEP += Makefile venv.mk package.mk
PKG_DEP += pyproject.toml
PKG_DEP += $(LIB_MAX7K_SRC)
# Install the packages required for packaging
.PHONY: venv_packaging
venv_packaging: $(VENV_PACKAGING)
$(VENV_PACKAGING): build/requirements.txt $(DIR_VENV)
source $(DIR_VENV)/bin/activate && \
pip3 install -r $<
@touch --no-create $@
# Entrypoint for packaging
.PHONY: package
package: dist
# Build package (wheel)
.SECONDARY: dist
dist: $(PKG_DEP)
source "$(DIR_VENV)/bin/activate" && \
python3 -m build --wheel
@touch --no-create "$@"
# Remove all packaging artifacts
.PHONY: clean_package
clean_package:
@rm -vfr build/{bdist*,lib*} dist/ *.egg-info/