Skip to content

Commit 4b24c39

Browse files
author
MarcoFalke
committed
Merge #19504: Bump minimum python version to 3.6
97c738f [tests] Recommend f-strings for formatting, update feature_block to use them (Anthony Towns) 8ae9d31 Bump minimum python version to 3.6 (Anthony Towns) Pull request description: Python 3.5 has reached [end-of-life](https://devguide.python.org/#status-of-python-branches) as of September 2020, and 3.6 has some moderately nice [features](https://docs.python.org/3/whatsnew/3.6.html): - `f'x = {x}'` as an alternative to `'x = {}'.format(x)` format strings (cf bitcoin/bitcoin#13718 (comment)) - underscore separators for large numbers, like `1_234_567` - improvements to async - improvements to typing module Note that 3.6 is not available in xenial (16.04), but is available in bionic (18.04), while focal (20.04) has 3.8. CentOS 7 and 8 have 3.6.8, Debian stable has 3.7.3, and [gentoo and arch already had 3.6 and 3.7 in 2018](bitcoin/bitcoin#14954 (comment)). ACKs for top commit: MarcoFalke: re-ACK 97c738f Tree-SHA512: ec7fce68845edde4d61a42de12c065fd49e5217311a6fda1323206f091a0afd50f293645dffc27d420127e4e5deb864e953f1b67eff735a0dfbbedd7899a9d60
2 parents 132e1d8 + 97c738f commit 4b24c39

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.6
1+
3.6.12

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
env:
5858
cache: pip
5959
language: python
60-
python: '3.5' # Oldest supported version according to doc/dependencies.md
60+
python: '3.6' # Oldest supported version according to doc/dependencies.md
6161
install:
6262
- set -o errexit; source ./ci/lint/04_install.sh
6363
before_script:
@@ -71,6 +71,6 @@ jobs:
7171
FILE_ENV="./ci/test/00_setup_env_i686_centos.sh"
7272
7373
- stage: test
74-
name: 'x86_64 Linux [GOAL: install] [xenial] [no wallet]'
74+
name: 'x86_64 Linux [GOAL: install] [bionic] [no wallet]'
7575
env: >-
7676
FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh"

ci/test/00_setup_env_native_nowallet.sh

Lines changed: 3 additions & 3 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
10-
export DOCKER_NAME_TAG=ubuntu:16.04 # Use xenial to have one config run the tests in python3.5, see doc/dependencies.md
11-
export PACKAGES="python3-zmq clang-3.8 llvm-3.8" # Use clang-3.8 to test C++11 compatibility, see doc/dependencies.md
10+
export DOCKER_NAME_TAG=ubuntu:18.04 # Use bionic to have one config run the tests in python3.6, see doc/dependencies.md (3.6 is not available in xenial/16.04)
11+
export PACKAGES="python3-zmq clang-3.9 llvm-3.9" # Use clang-3.9 to test C++11 compatibility, see doc/dependencies.md (3.8 is not available in bionic)
1212
export DEP_OPTS="NO_WALLET=1"
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CC=clang-3.8 CXX=clang++-3.8 --with-boost-process"
14+
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CC=clang-3.9 CXX=clang++-3.9 --with-boost-process"

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ AC_PATH_TOOL(STRIP, strip)
107107
AC_PATH_TOOL(GCOV, gcov)
108108
AC_PATH_TOOL(LLVM_COV, llvm-cov)
109109
AC_PATH_PROG(LCOV, lcov)
110-
dnl Python 3.5 is specified in .python-version and should be used if available, see doc/dependencies.md
111-
AC_PATH_PROGS([PYTHON], [python3.5 python3.6 python3.7 python3.8 python3 python])
110+
dnl Python 3.6 is specified in .python-version and should be used if available, see doc/dependencies.md
111+
AC_PATH_PROGS([PYTHON], [python3.6 python3.7 python3.8 python3.9 python3 python])
112112
AC_PATH_PROG(GENHTML, genhtml)
113113
AC_PATH_PROG([GIT], [git])
114114
AC_PATH_PROG(CCACHE,ccache)

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ These are the dependencies currently used by Bitcoin Core. You can find instruct
1818
| librsvg | | | | | |
1919
| MiniUPnPc | [2.0.20180203](https://miniupnp.tuxfamily.org/files) | | No | | |
2020
| PCRE | | | | | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk) |
21-
| Python (tests) | | [3.5](https://www.python.org/downloads) | | | |
21+
| Python (tests) | | [3.6](https://www.python.org/downloads) | | | |
2222
| qrencode | [3.4.4](https://fukuchi.org/works/qrencode) | | No | | |
2323
| Qt | [5.9.8](https://download.qt.io/official_releases/qt/) | [5.5.1](https://github.com/bitcoin/bitcoin/issues/13478) | No | | |
2424
| SQLite | [3.32.1](https://sqlite.org/download.html) | [3.7.17](https://github.com/bitcoin/bitcoin/pull/19077) | | | |

test/functional/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ don't have test cases for.
3434
- When subclassing the BitcoinTestFramework, place overrides for the
3535
`set_test_params()`, `add_options()` and `setup_xxxx()` methods at the top of
3636
the subclass, then locally-defined helper methods, then the `run_test()` method.
37-
- Use `'{}'.format(x)` for string formatting, not `'%s' % x`.
37+
- Use `f'{x}'` for string formatting in preference to `'{}'.format(x)` or `'%s' % x`.
3838

3939
#### Naming guidelines
4040

test/functional/feature_block.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def run_test(self):
119119
# Allow the block to mature
120120
blocks = []
121121
for i in range(NUM_BUFFER_BLOCKS_TO_GENERATE):
122-
blocks.append(self.next_block("maturitybuffer.{}".format(i)))
122+
blocks.append(self.next_block(f"maturitybuffer.{i}"))
123123
self.save_spendable_output()
124124
self.send_blocks(blocks)
125125

@@ -151,8 +151,8 @@ def run_test(self):
151151
if template.valid_in_block:
152152
continue
153153

154-
self.log.info("Reject block with invalid tx: %s", TxTemplate.__name__)
155-
blockname = "for_invalid.%s" % TxTemplate.__name__
154+
self.log.info(f"Reject block with invalid tx: {TxTemplate.__name__}")
155+
blockname = f"for_invalid.{TxTemplate.__name__}"
156156
badblock = self.next_block(blockname)
157157
badtx = template.get_tx()
158158
if TxTemplate != invalid_txs.InputMissing:
@@ -1355,12 +1355,12 @@ def next_block(self, number, spend=None, additional_coinbase_value=0, script=CSc
13551355

13561356
# save the current tip so it can be spent by a later block
13571357
def save_spendable_output(self):
1358-
self.log.debug("saving spendable output %s" % self.tip.vtx[0])
1358+
self.log.debug(f"saving spendable output {self.tip.vtx[0]}")
13591359
self.spendable_outputs.append(self.tip)
13601360

13611361
# get an output that we previously marked as spendable
13621362
def get_spendable_output(self):
1363-
self.log.debug("getting spendable output %s" % self.spendable_outputs[0].vtx[0])
1363+
self.log.debug(f"getting spendable output {self.spendable_outputs[0].vtx[0]}")
13641364
return self.spendable_outputs.pop(0).vtx[0]
13651365

13661366
# move the tip back to a previous block

0 commit comments

Comments
 (0)