Skip to content

Commit a74d588

Browse files
author
MarcoFalke
committed
Merge #14954: build: Require python 3.5
fa27978 test: Remove python3.4 workaround in feature_dbcrash (MarcoFalke) dddd1d0 .python-version: Specify full version 3.5.6 (MarcoFalke) faa7cdf scripted-diff: Update copyright in ./test (MarcoFalke) fa0e65b scripted-diff: test: Remove brackets after assert (MarcoFalke) fab5a1e build: Require python 3.5 (MarcoFalke) fa6bf21 scripted-diff: test: Use py3.5 bytes::hex() method (MarcoFalke) Pull request description: Python 3.4 is EOL after March 2019, so switch to 3.5. See https://devguide.python.org/#status-of-python-branches This pull does the following in a bunch of commits: * scripted diff to use the `bytes::hex()` method in place of previous wrappers (`b2x`, `bytes_to_hex_str`, `hexlify`, ...) * Update the build system (gitian and travis) to remove python2.7 and replace it with python3.5 * Another scripted-diff to remove brackets after `assert`. This is unrelated to the python3.5 switch, but a stylistic commit, so probably not worth to split up. The motivation behind it is to avoid asserting on data structures (such as tuples of length one), which never fails: ```py >>> assert(False,) # with brackets >>> assert False, # without brackets SyntaxError: invalid syntax >>> assert False # proper assertion AssertionError ``` * And then a final scripted diff to update the copyright headers in the `test` subfolder, since I touched most of the files anyway and it wouldn't make sense to split this commit out into a separate pull. For reference (contributed by luke-jr): Ubuntu LTS (bionic): 3.6.5 Debian stable (stretch): 3.5.3 RHEL 8 (expected before v0.19): 3.6.x Gentoo stable: 3.6.5 Arch: 3.7.1 Tree-SHA512: 643c28cd2d5b9543ce4bf8ad2a8b282bc79b37dc5b25c9c8358e6ce201e2a67a546463e5f3430b16652eb2489d7c3ed4b0772cd2e2bf790fe68a5e3cc8a25029
2 parents 3800ca6 + fa27978 commit a74d588

File tree

88 files changed

+492
-621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+492
-621
lines changed

.python-version

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

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
env:
4747
cache: false
4848
language: python
49-
python: '3.4' # Oldest supported version according to doc/dependencies.md
49+
python: '3.5' # Oldest supported version according to doc/dependencies.md
5050
install:
5151
- set -o errexit; source .travis/lint_04_install.sh
5252
before_script:
@@ -158,7 +158,7 @@ jobs:
158158
name: 'macOS 10.10 [GOAL: deploy] [no functional tests]'
159159
env: >-
160160
HOST=x86_64-apple-darwin14
161-
PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python3-setuptools-git"
161+
PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools-git"
162162
OSX_SDK=10.11
163163
RUN_UNIT_TESTS=false
164164
RUN_FUNCTIONAL_TESTS=false

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ AC_PATH_TOOL(RANLIB, ranlib)
8585
AC_PATH_TOOL(STRIP, strip)
8686
AC_PATH_TOOL(GCOV, gcov)
8787
AC_PATH_PROG(LCOV, lcov)
88-
dnl Python 3.4 is specified in .python-version and should be used if available, see doc/dependencies.md
89-
AC_PATH_PROGS([PYTHON], [python3.4 python3.5 python3.6 python3.7 python3 python])
88+
dnl Python 3.5 is specified in .python-version and should be used if available, see doc/dependencies.md
89+
AC_PATH_PROGS([PYTHON], [python3.5 python3.6 python3.7 python3.8 python3 python])
9090
AC_PATH_PROG(GENHTML, genhtml)
9191
AC_PATH_PROG([GIT], [git])
9292
AC_PATH_PROG(CCACHE,ccache)

contrib/devtools/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ still compatible with the minimum supported Linux distribution versions.
167167

168168
Example usage after a gitian build:
169169

170-
find ../gitian-builder/build -type f -executable | xargs python contrib/devtools/symbol-check.py
170+
find ../gitian-builder/build -type f -executable | xargs python3 contrib/devtools/symbol-check.py
171171

172172
If only supported symbols are used the return value will be 0 and the output will be empty.
173173

contrib/devtools/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
Example usage:
1111
12-
find ../gitian-builder/build -type f -executable | xargs python contrib/devtools/symbol-check.py
12+
find ../gitian-builder/build -type f -executable | xargs python3 contrib/devtools/symbol-check.py
1313
'''
1414
import subprocess
1515
import re

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ packages:
3030
- "faketime"
3131
- "bsdmainutils"
3232
- "ca-certificates"
33-
- "python"
33+
- "python3"
3434
remotes:
3535
- "url": "https://github.com/bitcoin/bitcoin.git"
3636
"dir": "bitcoin"

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ packages:
2323
- "libcap-dev"
2424
- "libz-dev"
2525
- "libbz2-dev"
26-
- "python"
27-
- "python-dev"
28-
- "python-setuptools"
26+
- "python3"
27+
- "python3-dev"
28+
- "python3-setuptools"
2929
- "fonts-tuffy"
3030
remotes:
3131
- "url": "https://github.com/bitcoin/bitcoin.git"

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ packages:
2020
- "nsis"
2121
- "zip"
2222
- "ca-certificates"
23-
- "python"
23+
- "python3"
2424
- "rename"
2525
remotes:
2626
- "url": "https://github.com/bitcoin/bitcoin.git"

contrib/linearize/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Linearize
2-
Construct a linear, no-fork, best version of the Bitcoin blockchain. The scripts
3-
run using Python 3 but are compatible with Python 2.
2+
Construct a linear, no-fork, best version of the Bitcoin blockchain.
43

54
## Step 1: Download hash list
65

contrib/linearize/linearize-data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import datetime
1717
import time
1818
from collections import namedtuple
19-
from binascii import hexlify, unhexlify
19+
from binascii import unhexlify
2020

2121
settings = {}
2222

@@ -61,7 +61,7 @@ def calc_hash_str(blk_hdr):
6161
hash = calc_hdr_hash(blk_hdr)
6262
hash = bufreverse(hash)
6363
hash = wordreverse(hash)
64-
hash_str = hexlify(hash).decode('utf-8')
64+
hash_str = hash.hex()
6565
return hash_str
6666

6767
def get_blk_dt(blk_hdr):
@@ -213,7 +213,7 @@ def run(self):
213213

214214
inMagic = inhdr[:4]
215215
if (inMagic != self.settings['netmagic']):
216-
print("Invalid magic: " + hexlify(inMagic).decode('utf-8'))
216+
print("Invalid magic: " + inMagic.hex())
217217
return
218218
inLenLE = inhdr[4:]
219219
su = struct.unpack("<I", inLenLE)

0 commit comments

Comments
 (0)