Marcel Telka
2022-11-08 b991b20641862ae8e8a7e7ed8a84abcab3da99ca
Move rules for fake Python 3.7 bootstrap to pyproject.mk

5 files modified
135 ■■■■ changed files
components/python/flit_core/python-integrate-project.conf 25 ●●●●● patch | view | raw | blame | history
components/python/importlib_metadata/python-integrate-project.conf 26 ●●●●● patch | view | raw | blame | history
components/python/pep517/python-integrate-project.conf 25 ●●●●● patch | view | raw | blame | history
components/python/typing_extensions/python-integrate-project.conf 25 ●●●●● patch | view | raw | blame | history
make-rules/pyproject.mk 34 ●●●●● patch | view | raw | blame | history
components/python/flit_core/python-integrate-project.conf
@@ -23,28 +23,3 @@
# Disable tests because required packages are not available during bootstrap
TEST_STYLE = none
%include-3%
# flit_core does not support setup.py build style so we cannot defer to it for
# bootstrapping Python 3.7.  Use 'build' and 'installer' instead (because
# pyproject_installer does not support Python 3.7).  Strictly speaking this is
# not true bootstrap, but since we do not need to bootstrap Python 3.7 from
# scratch we can afford this fake bootstrap keeping in mind that Python 3.7
# should be EOLed in June 2023.
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_CMD =        $(PYTHON) -m build
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS =
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --wheel
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --no-isolation
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_CMD =        $(PYTHON) -m installer
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS =
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    --destdir $(PROTO_DIR)
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    $(@D)/dist/*.whl
USERLAND_REQUIRED_PACKAGES += library/python/build-37
USERLAND_REQUIRED_PACKAGES += library/python/installer-37
BOOTSTRAP_TRANSFORMS =
%hook-manifest%
# Once the Python 3.7 is obsoleted the following two lines should be removed
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/flit_core-.*\\.dist-info/LICENSE -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/flit_core-.*\\.dist-info/WHEEL -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
components/python/importlib_metadata/python-integrate-project.conf
@@ -22,29 +22,3 @@
# Disable tests because required packages are not available during bootstrap
TEST_STYLE = none
%include-3%
# importlib_metadata does not support setup.py build style so we cannot defer
# to it for bootstrapping Python 3.7.  Use 'build' and 'installer' instead
# (because pyproject_installer does not support Python 3.7).  Strictly speaking
# this is not true bootstrap, but since we do not need to bootstrap Python 3.7
# from scratch we can afford this fake bootstrap keeping in mind that Python
# 3.7 should be EOLed in June 2023.
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_CMD =        $(PYTHON) -m build
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS =
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --wheel
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --no-isolation
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_CMD =        $(PYTHON) -m installer
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS =
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    --destdir $(PROTO_DIR)
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    $(@D)/dist/*.whl
USERLAND_REQUIRED_PACKAGES += library/python/build-37
USERLAND_REQUIRED_PACKAGES += library/python/installer-37
BOOTSTRAP_TRANSFORMS =
%hook-manifest%
# Once the Python 3.7 is obsoleted the following three lines should be removed
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/importlib_metadata-.*\\.dist-info/LICENSE -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/importlib_metadata-.*\\.dist-info/WHEEL -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/importlib_metadata-.*\\.dist-info/top_level.txt -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
components/python/pep517/python-integrate-project.conf
@@ -21,28 +21,3 @@
# Disable tests because required packages are not available during bootstrap
TEST_STYLE = none
%include-3%
# This components does not support setup.py build style so we cannot defer to
# it for bootstrapping Python 3.7.  Use 'build' and 'installer' instead
# (because pyproject_installer does not support Python 3.7).  Strictly speaking
# this is not true bootstrap, but since we do not need to bootstrap Python 3.7
# from scratch we can afford this fake bootstrap keeping in mind that Python
# 3.7 should be EOLed in June 2023.
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_CMD =        $(PYTHON) -m build
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS =
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --wheel
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --no-isolation
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_CMD =        $(PYTHON) -m installer
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS =
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    --destdir $(PROTO_DIR)
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    $(@D)/dist/*.whl
USERLAND_REQUIRED_PACKAGES += library/python/build-37
USERLAND_REQUIRED_PACKAGES += library/python/installer-37
BOOTSTRAP_TRANSFORMS =
%hook-manifest%
# Once the Python 3.7 is obsoleted the following two lines should be removed
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/pep517-.*\\.dist-info/LICENSE -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/pep517-.*\\.dist-info/WHEEL -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
components/python/typing_extensions/python-integrate-project.conf
@@ -21,28 +21,3 @@
# Disable tests because required packages are not available during bootstrap
TEST_STYLE = none
%include-3%
# typing_extensions does not support setup.py build style so we cannot defer to
# it for bootstrapping Python 3.7.  Use 'build' and 'installer' instead
# (because pyproject_installer does not support Python 3.7).  Strictly speaking
# this is not true bootstrap, but since we do not need to bootstrap Python 3.7
# from scratch we can afford this fake bootstrap keeping in mind that Python
# 3.7 should be EOLed in June 2023.
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_CMD =        $(PYTHON) -m build
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS =
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --wheel
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --no-isolation
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_CMD =        $(PYTHON) -m installer
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS =
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    --destdir $(PROTO_DIR)
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    $(@D)/dist/*.whl
USERLAND_REQUIRED_PACKAGES += library/python/build-37
USERLAND_REQUIRED_PACKAGES += library/python/installer-37
BOOTSTRAP_TRANSFORMS =
%hook-manifest%
# Once the Python 3.7 is obsoleted the following two lines should be removed
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/typing_extensions-.*\\.dist-info/LICENSE -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
printf '<transform file path=usr/lib/python3\\.9/vendor-packages/typing_extensions-.*\\.dist-info/WHEEL -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m"
make-rules/pyproject.mk
@@ -68,6 +68,40 @@
# Special transforms needed only until we drop support for Python 3.7
BOOTSTRAP_TRANSFORMS =    $(WS_TOP)/transforms/python-bootstrap
PUBLISH_TRANSFORMS +=    $(BOOTSTRAP_TRANSFORMS)
ifeq ($(wildcard $(SOURCE_DIR)/setup.py),)
# If the component does not support setup.py build style we cannot defer to it
# for bootstrapping Python 3.7.  We will use 'build' and 'installer' instead.
# Strictly speaking this is not true bootstrap, but since we do not need to
# bootstrap Python 3.7 from scratch we can afford this fake bootstrap keeping
# in mind that Python 3.7 should be EOLed in June 2023.
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_CMD =        $(PYTHON) -m build
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS =
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --wheel
$(BUILD_DIR)/%-3.7/.built:    COMPONENT_BUILD_ARGS +=        --no-isolation
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_CMD =        $(PYTHON) -m installer
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS =
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    --destdir $(PROTO_DIR)
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_INSTALL_ARGS +=    $(@D)/dist/*.whl
USERLAND_REQUIRED_PACKAGES += library/python/build-37
USERLAND_REQUIRED_PACKAGES += library/python/installer-37
# We do not need special transforms for fake bootstrap
BOOTSTRAP_TRANSFORMS =
# Remove all files from dist-info directory except METADATA to get similar
# layout as with pyproject_installer
$(BUILD_DIR)/%-3.7/.installed:    COMPONENT_POST_INSTALL_ACTION += \
    ( cd $(PROTO_DIR)/$(PYTHON_LIB)/$(COMPONENT_NAME)-$(COMPONENT_VERSION).dist-info ; \
    for f in * ; do \
        [[ "$$f" == "METADATA" ]] && continue ; \
        [[ -f "$$f" ]] || continue ; \
        $(RM) $$f ; \
    done ) ;
endif
else
COMPONENT_BUILD_CMD =        $(PYTHON) -m build
COMPONENT_BUILD_ARGS =