From fc0515b9830f3d8150302c817879d05a92816ca1 Mon Sep 17 00:00:00 2001 From: Niklas Dusenlund Date: Fri, 23 Aug 2024 12:03:19 +0200 Subject: [PATCH] Dockerfile: Use `python3` executable. Python should be invoked as `python3` since we are writing python3 code and not python2. See https://peps.python.org/pep-0394/#recommendation Many (most?) distributions do not distribute a "python" executable any more, forcing you to pick either 2 or 3. --- .containerversion | 2 +- Dockerfile | 3 --- external/CMakeLists.txt | 1 + scripts/expand_template | 2 +- scripts/get_version | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.containerversion b/.containerversion index d81cc0710..920a13966 100644 --- a/.containerversion +++ b/.containerversion @@ -1 +1 @@ -42 +43 diff --git a/Dockerfile b/Dockerfile index 7a69124fd..1269ee2e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -117,9 +117,6 @@ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ rm /tmp/protoc-21.2.zip ENV PATH /opt/protoc/bin:$PATH -# Make Python3 the default -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 - # Developer tools RUN apt-get update && apt-get install -y \ bash-completion diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index f2d3cfa88..178b4927c 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -52,6 +52,7 @@ ExternalProject_Add(libwally-core COMMAND ${CMAKE_COMMAND} -E env "CFLAGS=${LIBWALLY_CFLAGS}" "LDFLAGS=${LIBWALLY_LDFLAGS}" + PYTHON_VERSION=3 ${CMAKE_CURRENT_SOURCE_DIR}/libwally-core/configure ${CONFIGURE_FLAGS} ${LIBWALLY_CONFIGURE_FLAGS} diff --git a/scripts/expand_template b/scripts/expand_template index ec17524a7..e8fb133b0 100755 --- a/scripts/expand_template +++ b/scripts/expand_template @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Expand python templates""" from string import Template diff --git a/scripts/get_version b/scripts/get_version index fe8b88975..a407eb0e6 100755 --- a/scripts/get_version +++ b/scripts/get_version @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Parse the tags and strip the prefix First argument should be prefix to match against