Skip to content

Commit d89aca1

Browse files
committed
Merge bitcoin/bitcoin#27483: Bump python minimum version to 3.8
fac395e ci: Bump ci/lint/Dockerfile (MarcoFalke) fa6eb65 test: Use python3.8 pow() (MarcoFalke) 88881cf Bump python minimum version to 3.8 (MarcoFalke) Pull request description: There is no pressing reason to drop support for 3.7, however there are several maintenance issues: * There is no supported operating system that ships 3.7 by default. (debian:buster is EOL and unmaintained to the extent that it doesn't run in the CI environment. See bitcoin/bitcoin#27340 (comment)) * Compiling python 3.7 from source is also unsupported on at least macos, according to bitcoin/bitcoin#24017 (comment) * Recent versions of lief require 3.8, see bitcoin/bitcoin#27507 (comment) Fix all maintenance issues by bumping the minimum. ACKs for top commit: RandyMcMillan: ACK fac395e fjahr: ACK fac395e fanquake: ACK fac395e Tree-SHA512: c198decdbbe29d186d73ea3f6549d8a38479383495d14a965a2f9211ce39637b43f13a4c2a5d3bf56e2d468be4bbe49b4ee8e8e19ec69936ff43ddf2b714c712
2 parents 904a987 + fac395e commit d89aca1

File tree

9 files changed

+16
-26
lines changed

9 files changed

+16
-26
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ task:
228228
PACKAGE_MANAGER_INSTALL: "yum install -y"
229229

230230
task:
231-
name: '[previous releases, uses qt5 dev package and some depends packages, DEBUG] [unsigned char] [buster]'
231+
name: '[previous releases, qt5 dev package and depends packages, DEBUG] [focal]'
232232
previous_releases_cache:
233233
folder: "releases"
234234
<< : *GLOBAL_TASK_TEMPLATE

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.16
1+
3.8.16

ci/lint/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# entire repo as docker context during build; if it lived elsewhere, it wouldn't be
66
# able to make back-references to pull in the install scripts. So here it lives.
77

8-
FROM python:3.7-buster
8+
FROM python:3.8-buster
99

1010
ENV DEBIAN_FRONTEND=noninteractive
1111
ENV LC_ALL=C.UTF-8

ci/test/00_setup_env_i686_centos.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export LC_ALL=C.UTF-8
88

99
export HOST=i686-pc-linux-gnu
1010
export CONTAINER_NAME=ci_i686_centos
11-
export CI_IMAGE_NAME_TAG=quay.io/centos/centos:stream8
11+
export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream8"
12+
# Use minimum supported python3.8 and gcc-8, see doc/dependencies.md
1213
export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python38 python38-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison"
1314
export PIP_PACKAGES="pyzmq"
1415
export GOAL="install"

ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel
10-
export CI_IMAGE_NAME_TAG=ubuntu:focal
11-
# Use minimum supported python3.7 (or python3.8, as best-effort) and clang-8, see doc/dependencies.md
10+
export CI_IMAGE_NAME_TAG="ubuntu:20.04"
11+
# Use minimum supported python3.8 and clang-8, see doc/dependencies.md
1212
export PACKAGES="python3-zmq clang-8 llvm-8 libc++abi-8-dev libc++-8-dev"
1313
export DEP_OPTS="NO_WALLET=1 CC=clang-8 CXX='clang++-8 -stdlib=libc++'"
1414
export GOAL="install"

ci/test/00_setup_env_native_qt5.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_qt5
10-
export CI_IMAGE_NAME_TAG=debian:buster
11-
# Use minimum supported python3.7 and gcc-8, see doc/dependencies.md
12-
export PACKAGES="gcc-8 g++-8 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
13-
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-8 CXX=g++-8"
10+
export CI_IMAGE_NAME_TAG="ubuntu:20.04"
11+
# Use minimum supported python3.8 and gcc-8 (or best-effort gcc-9), see doc/dependencies.md
12+
export PACKAGES="gcc-9 g++-9 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
13+
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-9 CXX=g++-9"
1414
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
1515
export RUN_UNIT_TESTS_SEQUENTIAL="true"
1616
export RUN_UNIT_TESTS="false"
1717
export GOAL="install"
1818
export NO_WERROR=1
1919
export DOWNLOAD_PREVIOUS_RELEASES="true"
2020
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \
21-
--enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" CC=gcc-8 CXX=g++-8"
21+
--enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\""

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ AC_PATH_TOOL([AR], [ar])
126126
AC_PATH_TOOL([GCOV], [gcov])
127127
AC_PATH_TOOL([LLVM_COV], [llvm-cov])
128128
AC_PATH_PROG([LCOV], [lcov])
129-
dnl Python 3.7 is specified in .python-version and should be used if available, see doc/dependencies.md
130-
AC_PATH_PROGS([PYTHON], [python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 python3 python])
129+
dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md
130+
AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python])
131131
AC_PATH_PROG([GENHTML], [genhtml])
132132
AC_PATH_PROG([GIT], [git])
133133
AC_PATH_PROG([CCACHE], [ccache])

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
1010
| [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) |
1111
| [Clang](https://clang.llvm.org) | [8.0](https://github.com/bitcoin/bitcoin/pull/24164) |
1212
| [GCC](https://gcc.gnu.org) | [8.1](https://github.com/bitcoin/bitcoin/pull/23060) |
13-
| [Python](https://www.python.org) (tests) | [3.7](https://github.com/bitcoin/bitcoin/pull/26226) |
13+
| [Python](https://www.python.org) (scripts, tests) | [3.8](https://github.com/bitcoin/bitcoin/pull/27483) |
1414
| [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A |
1515

1616
## Required

test/functional/test_framework/util.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -542,18 +542,7 @@ def modinv(a, n):
542542
"""Compute the modular inverse of a modulo n using the extended Euclidean
543543
Algorithm. See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Modular_integers.
544544
"""
545-
# TODO: Change to pow(a, -1, n) available in Python 3.8
546-
t1, t2 = 0, 1
547-
r1, r2 = n, a
548-
while r2 != 0:
549-
q = r1 // r2
550-
t1, t2 = t2, t1 - q * t2
551-
r1, r2 = r2, r1 - q * r2
552-
if r1 > 1:
553-
return None
554-
if t1 < 0:
555-
t1 += n
556-
return t1
545+
return pow(a, -1, n)
557546

558547
class TestFrameworkUtil(unittest.TestCase):
559548
def test_modinv(self):

0 commit comments

Comments
 (0)