Skip to content

Commit 0a031ce

Browse files
Move all scripts and documentation to Python3 (#6378)
* Move all scripts and documentation to Python3 Python 2 EOL is Jan 1, 2020. Migrate scripts to run under Python 3. Under Windows, we're already running Python 3.7, by dumb luck. The oddness is that the Windows standalone executable for Python 3 is called "python" whereas under UNIX-like OSes it's called "python3" with "python" always referring to the Python 2 executable. The ZIP needs to be updated to include a Python3.exe (copy of Python.exe) so that we can use the same command lines under Linux and Windows, and to preserve my sanity. Fixes #6376 * Add new Windows ZIP with python3.exe file * Sort options in boards.txt generation for repeatability The order of the board opts dict changes depending on the Python version and machine, so sort the options before printing them to get a stable ordering. * Re-add Python2 compatibility tweaks Most scripts can run as Python 2 or Python 3 with minimal changes, so re-add (and fix, as necessary) compatibility tweaks to the scripts.
1 parent 1800bb5 commit 0a031ce

23 files changed

+112
-102
lines changed

boards.txt

+16-16
Original file line numberDiff line numberDiff line change
@@ -761,15 +761,15 @@ esp8285.menu.baud.3000000.upload.speed=3000000
761761
espduino.name=ESPDuino (ESP-13 Module)
762762
espduino.build.board=ESP8266_ESP13
763763
espduino.build.variant=ESPDuino
764-
espduino.menu.ResetMethod.v2=ESPduino-V2
765-
espduino.menu.ResetMethod.v2.upload.resetmethod=nodemcu
766764
espduino.menu.ResetMethod.v1=ESPduino-V1
767765
espduino.menu.ResetMethod.v1.upload.resetmethod=ck
766+
espduino.menu.ResetMethod.v2=ESPduino-V2
767+
espduino.menu.ResetMethod.v2.upload.resetmethod=nodemcu
768+
espduino.menu.UploadTool.espota=OTA
769+
espduino.menu.UploadTool.espota.upload.tool=espota
768770
espduino.menu.UploadTool.esptool=Serial
769771
espduino.menu.UploadTool.esptool.upload.tool=esptool
770772
espduino.menu.UploadTool.esptool.upload.verbose=--trace
771-
espduino.menu.UploadTool.espota=OTA
772-
espduino.menu.UploadTool.espota.upload.tool=espota
773773
espduino.upload.tool=esptool
774774
espduino.upload.maximum_data_size=81920
775775
espduino.upload.wait_for_upload_port=true
@@ -4592,20 +4592,20 @@ wifinfo.build.board=WIFINFO
45924592
wifinfo.build.variant=wifinfo
45934593
wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
45944594
wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
4595-
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
45964595
wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
4597-
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
4598-
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
4596+
wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
45994597
wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
4598+
wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
4599+
wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
46004600
wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
46014601
wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
46024602
wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
4603-
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
46044603
wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
4605-
wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000
4606-
wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000
4604+
wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
46074605
wifinfo.menu.ESPModule.ESP12.build.spiffs_blocksize=8192
4606+
wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000
46084607
wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256
4608+
wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000
46094609
wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464
46104610
wifinfo.upload.tool=esptool
46114611
wifinfo.upload.maximum_data_size=81920
@@ -4839,16 +4839,16 @@ arduino-esp8266.name=Arduino
48394839
arduino-esp8266.build.board=ESP8266_ARDUINO
48404840
arduino-esp8266.menu.BoardModel.primo=Primo
48414841
arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO
4842-
arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi
48434842
arduino-esp8266.menu.BoardModel.primo.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
4844-
arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi
4845-
arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI
4846-
arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart
4847-
arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
4843+
arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi
48484844
arduino-esp8266.menu.BoardModel.starottodeved=Star OTTO
4849-
arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart
48504845
arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO
48514846
arduino-esp8266.menu.BoardModel.starottodeved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
4847+
arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart
4848+
arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi
4849+
arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI
4850+
arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
4851+
arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart
48524852
arduino-esp8266.upload.tool=esptool
48534853
arduino-esp8266.upload.maximum_data_size=81920
48544854
arduino-esp8266.upload.wait_for_upload_port=true

doc/eclipse/makefile.init

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ESP8266_BASE = $(ARDUINO_BASE)/hardware/esp8266com/esp8266
1414
ESP8266_TOOLS = $(ESP8266_BASE)/tools
1515
XTENSA_TOOLS_ROOT = $(ESP8266_TOOLS)/xtensa-lx106-elf/bin
1616

17-
PYTHON_BIN = python
17+
PYTHON_BIN = python3
1818
ESPTOOL_PY_BIN = $(ESP8266_TOOLS)/esptool.py
1919
ESPOTA_PY_BIN = $(ESP8266_TOOLS)/espota.py
2020
ESPTOOL_BIN = $(ESP8266_TOOLS)/esptool/esptool.exe

doc/installing.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Prerequisites
4343

4444
- Arduino 1.6.8 (or newer, current working version is 1.8.5)
4545
- git
46-
- Python 2.7 (https://python.org)
46+
- Python 3.x (https://python.org)
4747
- terminal, console, or command prompt (depending on your OS)
4848
- Internet connection
4949

@@ -110,7 +110,7 @@ Instructions - Windows 10
110110
.. code:: bash
111111
112112
cd esp8266/tools
113-
python get.py
113+
python3 get.py
114114
115115
- Restart Arduino
116116
@@ -184,7 +184,7 @@ Instructions - Other OS
184184
.. code:: bash
185185
186186
cd esp8266/tools
187-
python get.py
187+
python3 get.py
188188
189189
- Restart Arduino
190190

doc/ota_updates/readme.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) boa
193193
- esp8266/Arduino platform package 2.0.0 or newer - for instructions
194194
follow
195195
https://github.com/esp8266/Arduino#installing-with-boards-manager
196-
- Python 2.7 - https://www.python.org/
196+
- Python 3.x - https://www.python.org/
197197

198198
**Note:** Windows users should select “Add python.exe to Path”
199199
(see below – this option is not selected by default).

libraries/ESP8266WiFi/examples/BearSSL_CertStore/certs-from-mozilla.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/python3
22

33
# This script pulls the list of Mozilla trusted certificate authorities
44
# from the web at the "mozurl" below, parses the file to grab the PEM
@@ -7,16 +7,18 @@
77
# and use them for your outgoing SSL connections.
88
#
99
# Script by Earle F. Philhower, III. Released to the public domain.
10-
10+
from __future__ import print_function
1111
import csv
1212
import os
13+
import sys
1314
from subprocess import Popen, PIPE, call
14-
import urllib2
1515
try:
16-
# for Python 2.x
16+
from urllib.request import urlopen
17+
except:
18+
from urllib2 import urlopen
19+
try:
1720
from StringIO import StringIO
18-
except ImportError:
19-
# for Python 3.x
21+
except:
2022
from io import StringIO
2123

2224
# Mozilla's URL for the CSV file with included PEM certs
@@ -25,9 +27,12 @@
2527
# Load the manes[] and pems[] array from the URL
2628
names = []
2729
pems = []
28-
response = urllib2.urlopen(mozurl)
30+
response = urlopen(mozurl)
2931
csvData = response.read()
30-
csvReader = csv.reader(StringIO(csvData))
32+
if sys.version_info[0] > 2:
33+
csvData = csvData.decode('utf-8')
34+
csvFile = StringIO(csvData)
35+
csvReader = csv.reader(csvFile)
3136
for row in csvReader:
3237
names.append(row[0]+":"+row[1]+":"+row[2])
3338
pems.append(row[30])
@@ -46,10 +51,10 @@
4651
for i in range(0, len(pems)):
4752
certName = "data/ca_%03d.der" % (idx);
4853
thisPem = pems[i].replace("'", "")
49-
print names[i] + " -> " + certName
54+
print(names[i] + " -> " + certName)
5055
ssl = Popen(['openssl','x509','-inform','PEM','-outform','DER','-out', certName], shell = False, stdin = PIPE)
5156
pipe = ssl.stdin
52-
pipe.write(thisPem)
57+
pipe.write(thisPem.encode('utf-8'))
5358
pipe.close()
5459
ssl.wait()
5560
if os.path.exists(certName):

package/build_boards_manager_package.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fi
7474
# handles tool paths differently when package is installed in hardware folder
7575
cat $srcdir/platform.txt | \
7676
$SED 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \
77-
$SED 's/runtime.tools.python.path=.*//g' | \
77+
$SED 's/runtime.tools.python3.path=.*//g' | \
7878
$SED 's/runtime.tools.esptool.path={runtime.platform.path}\/tools\/esptool//g' | \
7979
$SED 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' | \
8080
$SED 's/^tools.esptool.cmd=.*//g' | \
@@ -156,7 +156,7 @@ new_json=package_esp8266com_index.json
156156

157157
set +e
158158
# Merge the old and new, then drop any obsolete package versions
159-
python ../../merge_packages.py $new_json $old_json | python ../../drop_versions.py - tools 1.20.0-26-gb404fb9 >tmp && mv tmp $new_json && rm $old_json
159+
python3 ../../merge_packages.py $new_json $old_json | python3 ../../drop_versions.py - tools 1.20.0-26-gb404fb9 >tmp && mv tmp $new_json && rm $old_json
160160

161161
# Verify the JSON file can be read, fail if it's not OK
162162
set -e

package/drop_versions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# This script drops one or multiple versions of a release
33
#
44
from __future__ import print_function

package/merge_packages.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# This script merges two Arduino Board Manager package json files.
33
# Usage:
44
# python merge_packages.py package_esp8266com_index.json version/new/package_esp8266com_index.json

package/package_esp8266com_index.template.json

+28-28
Original file line numberDiff line numberDiff line change
@@ -142,52 +142,52 @@
142142
"systems": [
143143
{
144144
"host": "x86_64-mingw32",
145-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-3.7.2.post1-embed-win32v2.zip",
146-
"archiveFileName": "python-3.7.2.post1-embed-win32v2.zip",
147-
"checksum": "SHA-256:26665d2925ee75118bb7d8620e9ee988adc2ca3e660a9f4c06a09a06c94c0c29",
148-
"size": "6431781"
145+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python-3.7.2.post1-embed-win32v2a.zip",
146+
"archiveFileName": "python-3.7.2.post1-embed-win32v2a.zip",
147+
"checksum": "SHA-256:8eb71cd637c42abbeea9f31912bbaca22222405d8624ace8901c801519321d35",
148+
"size": "6481988"
149149
},
150150
{
151151
"host": "i686-mingw32",
152-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-3.7.2.post1-embed-win32v2.zip",
153-
"archiveFileName": "python-3.7.2.post1-embed-win32v2.zip",
154-
"checksum": "SHA-256:26665d2925ee75118bb7d8620e9ee988adc2ca3e660a9f4c06a09a06c94c0c29",
155-
"size": "6431781"
152+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python-3.7.2.post1-embed-win32v2a.zip",
153+
"archiveFileName": "python-3.7.2.post1-embed-win32va2.zip",
154+
"checksum": "SHA-256:8eb71cd637c42abbeea9f31912bbaca22222405d8624ace8901c801519321d35",
155+
"size": "6481988"
156156
},
157157
{
158158
"host": "aarch64-linux-gnu",
159-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
160-
"archiveFileName": "python-placeholder.tar.gz",
161-
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
162-
"size": "193"
159+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
160+
"archiveFileName": "python3-placeholder.tar.gz",
161+
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
162+
"size": "191"
163163
},
164164
{
165165
"host": "arm-linux-gnueabihf",
166-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
167-
"archiveFileName": "python-placeholder.tar.gz",
168-
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
169-
"size": "193"
166+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
167+
"archiveFileName": "python3-placeholder.tar.gz",
168+
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
169+
"size": "191"
170170
},
171171
{
172172
"host": "i686-pc-linux-gnu",
173-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
174-
"archiveFileName": "python-placeholder.tar.gz",
175-
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
176-
"size": "193"
173+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
174+
"archiveFileName": "python3-placeholder.tar.gz",
175+
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
176+
"size": "191"
177177
},
178178
{
179179
"host": "x86_64-apple-darwin",
180-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
181-
"archiveFileName": "python-placeholder.tar.gz",
182-
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
183-
"size": "193"
180+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
181+
"archiveFileName": "python3-placeholder.tar.gz",
182+
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
183+
"size": "191"
184184
},
185185
{
186186
"host": "x86_64-pc-linux-gnu",
187-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
188-
"archiveFileName": "python-placeholder.tar.gz",
189-
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
190-
"size": "193"
187+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
188+
"archiveFileName": "python3-placeholder.tar.gz",
189+
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
190+
"size": "191"
191191
}
192192
]
193193
},

platform.txt

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ version=2.6.0-dev
1010

1111
# These will be removed by the packager script when doing a JSON release
1212
runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf
13-
runtime.tools.python.path={runtime.platform.path}/tools/python
13+
runtime.tools.python3.path={runtime.platform.path}/tools/python3
1414

1515
runtime.tools.esptool.path={runtime.platform.path}/tools/esptool
1616
runtime.tools.signing={runtime.platform.path}/tools/signing.py
@@ -84,8 +84,8 @@ compiler.elf2hex.extra_flags=
8484

8585
## generate file with git version number
8686
## needs bash, git, and echo
87-
recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h"
88-
recipe.hooks.core.prebuild.pattern="{runtime.tools.python.path}/python" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}"
87+
recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h"
88+
recipe.hooks.core.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}"
8989

9090
## Build the app.ld linker file
9191
recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld"
@@ -109,8 +109,8 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_
109109
recipe.objcopy.eep.pattern=
110110

111111
## Create hex
112-
recipe.objcopy.hex.1.pattern="{runtime.tools.python.path}/python" "{runtime.tools.elf2bin}" --eboot "{runtime.tools.eboot}" --app "{build.path}/{build.project_name}.elf" --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --out "{build.path}/{build.project_name}.bin"
113-
recipe.objcopy.hex.2.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode sign --privatekey "{build.source.path}/private.key" --bin "{build.path}/{build.project_name}.bin" --out "{build.path}/{build.project_name}.bin.signed" --legacy "{build.path}/{build.project_name}.bin.legacy_sig"
112+
recipe.objcopy.hex.1.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.elf2bin}" --eboot "{runtime.tools.eboot}" --app "{build.path}/{build.project_name}.elf" --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --out "{build.path}/{build.project_name}.bin"
113+
recipe.objcopy.hex.2.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode sign --privatekey "{build.source.path}/private.key" --bin "{build.path}/{build.project_name}.bin" --out "{build.path}/{build.project_name}.bin.signed" --legacy "{build.path}/{build.project_name}.bin.legacy_sig"
114114

115115
## Save hex
116116
recipe.output.tmp_file={build.project_name}.bin
@@ -126,12 +126,12 @@ recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*
126126

127127
tools.esptool.path=
128128
# Because the variable expansion doesn't allow one tool to find another, the following lines
129-
# will point to "{runtime.platform.path}/tools/python/python" in GIT and
130-
# "{runtime.tools.python.path}/python" for JSON board manager releases.
131-
#tools.esptool.cmd={runtime.tools.python.path}/python
132-
#tools.esptool.network_cmd={runtime.tools.python.path}/python
133-
tools.esptool.cmd={runtime.platform.path}/tools/python/python
134-
tools.esptool.network_cmd={runtime.platform.path}/tools/python/python
129+
# will point to "{runtime.platform.path}/tools/python3/python3" in GIT and
130+
# "{runtime.tools.python3.path}/python3" for JSON board manager releases.
131+
#tools.esptool.cmd={runtime.tools.python3.path}/python3
132+
#tools.esptool.network_cmd={runtime.tools.python3.path}/python3
133+
tools.esptool.cmd={runtime.platform.path}/tools/python3/python3
134+
tools.esptool.network_cmd={runtime.platform.path}/tools/python3/python3
135135

136136
tools.esptool.upload.protocol=esp
137137
tools.esptool.upload.params.verbose=--trace

tests/common.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function build_sketches()
6565
local build_rem=$5
6666
local lwip=$6
6767
mkdir -p $build_dir
68-
local build_cmd="python tools/build.py -b generic -v -w all -s 4M1M -v -k --build_cache $cache_dir -p $PWD/$build_dir -n $lwip $build_arg "
68+
local build_cmd="python3 tools/build.py -b generic -v -w all -s 4M1M -v -k --build_cache $cache_dir -p $PWD/$build_dir -n $lwip $build_arg "
6969
local sketches=$(find $srcpath -name *.ino | sort)
7070
print_size_info >size.log
7171
export ARDUINO_IDE_PATH=$arduino
@@ -163,7 +163,7 @@ function install_ide()
163163
cat esp8266/platform.local.txt
164164
echo -e "\n----\n"
165165
cd esp8266/tools
166-
python get.py
166+
python3 get.py
167167
export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH"
168168
}
169169

tests/device/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ TEST_LIST ?= $(wildcard test_*/*.ino)
44
ESP8266_CORE_PATH ?= $(realpath ../..)
55
BUILD_DIR ?= $(PWD)/.build
66
HARDWARE_DIR ?= $(PWD)/.hardware
7-
#PYTHON ?= python3
8-
PYTHON ?= python
7+
PYTHON ?= python3
98
ESPTOOL ?= $(PYTHON) $(ESP8266_CORE_PATH)/tools/esptool/esptool.py
109
MKSPIFFS ?= $(ESP8266_CORE_PATH)/tools/mkspiffs/mkspiffs
1110
UPLOAD_PORT ?= $(shell ls /dev/tty* | grep -m 1 -i USB)

tests/device/libraries/BSTest/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $(PYTHON_ENV_DIR):
1515
. $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt
1616

1717
test: $(TEST_EXECUTABLE) $(PYTHON_ENV_DIR)
18-
. $(PYTHON_ENV_DIR)/bin/activate && python runner.py -e $(TEST_EXECUTABLE) -m test/test.py
18+
. $(PYTHON_ENV_DIR)/bin/activate && $(PYTHON) runner.py -e $(TEST_EXECUTABLE) -m test/test.py
1919

2020
$(TEST_EXECUTABLE): test/test.cpp
2121
g++ -std=c++11 -Isrc -o $@ test/test.cpp

0 commit comments

Comments
 (0)