@@ -134,13 +134,13 @@ def get_espidf():
134
134
'lib/esp-idf'
135
135
]
136
136
137
- print ('collecting ESP-IDF v5.2.1 ' )
137
+ print ('collecting ESP-IDF v5.2.0 ' )
138
138
print ('this might take a while...' )
139
139
result , _ = spawn (cmd , spinner = True )
140
140
if result != 0 :
141
141
sys .exit (result )
142
142
143
- # cmd_ = ['cd lib/esp-idf && git checkout v5.2.1 ']
143
+ # cmd_ = ['cd lib/esp-idf && git checkout v5.2.0 ']
144
144
# spawn(cmd_, out_to_screen=False)
145
145
146
146
@@ -433,7 +433,7 @@ def setup_idf_environ():
433
433
434
434
idf_ver = get_idf_version ()
435
435
436
- if idf_ver is None or idf_ver != '5.2.1 ' :
436
+ if idf_ver is None or idf_ver != '5.2.0 ' :
437
437
idf_path = 'lib/esp-idf'
438
438
439
439
if os .path .exists (os .path .join (idf_path , 'export.sh' )):
@@ -532,12 +532,12 @@ def setup_idf_environ():
532
532
533
533
args = " " .join (args )
534
534
535
- print ('ESP-IDF version 5.2.1 is needed to compile' )
535
+ print ('ESP-IDF version 5.2.0 is needed to compile' )
536
536
print ('Please rerun the build using the command below...' )
537
537
print (f'"{ sys .executable } { args } "' )
538
538
raise RuntimeError
539
539
540
- elif idf_ver is not None and idf_ver == '5.2.1 ' :
540
+ elif idf_ver is not None and idf_ver == '5.2.0 ' :
541
541
env = os .environ
542
542
543
543
else :
@@ -565,7 +565,7 @@ def submodules():
565
565
if not sys .platform .startswith ('win' ):
566
566
idf_ver = get_idf_version ()
567
567
568
- if idf_ver is None or idf_ver != '5.2.1 ' :
568
+ if idf_ver is None or idf_ver != '5.2.0 ' :
569
569
idf_path = 'lib/esp-idf'
570
570
if not os .path .exists (os .path .join (idf_path , 'export.sh' )):
571
571
get_espidf ()
@@ -575,7 +575,7 @@ def submodules():
575
575
['./install.sh' , 'all' ]
576
576
]
577
577
578
- print ('setting up ESP-IDF v5.2.1 ' )
578
+ print ('setting up ESP-IDF v5.2.0 ' )
579
579
print ('this might take a while...' )
580
580
env = {
581
581
k : v for k , v in os .environ .items () if not k .startswith ('IDF' )
@@ -943,21 +943,23 @@ def compile(): # NOQA
943
943
944
944
if deploy :
945
945
python_env_path = os .path .split (os .path .split (python_path )[0 ])[0 ]
946
- python_version = os .path .split (python_env_path )[- 1 ].split ('_' )[1 ][2 :]
946
+ python_version = (
947
+ os .path .split (python_env_path )[- 1 ].split ('_' )[1 ][2 :]
948
+ )
947
949
site_packages = os .path .join (
948
950
python_env_path ,
949
951
f'lib/python{ python_version } /site-packages'
950
952
)
951
953
sys .path .insert (0 , site_packages )
952
954
953
- from esptool .targets import CHIP_DEFS
954
- from esptool .util import FatalError
955
+ from esptool .targets import CHIP_DEFS # NOQA
956
+ from esptool .util import FatalError # NOQA
955
957
from serial .tools import list_ports
956
958
957
959
cmd = cmd .replace ('-b 460800' , f'-b { BAUD } ' )
958
960
959
961
def get_port_list ():
960
- pts = sorted (ports .device for ports in list_ports .comports ())
962
+ pts = sorted (p .device for p in list_ports .comports ())
961
963
if sys .platform .startswith ('linux' ):
962
964
serial_path = '/dev/serial/by_id'
963
965
if os .path .exists (serial_path ):
@@ -971,10 +973,10 @@ def get_port_list():
971
973
972
974
def find_esp32 (chip ):
973
975
found_ports = []
974
- for port in get_port_list ():
976
+ for prt in get_port_list ():
975
977
chip_class = CHIP_DEFS [chip ]
976
978
try :
977
- _esp = chip_class (port , 115200 , False )
979
+ _esp = chip_class (prt , 115200 , False )
978
980
except (FatalError , OSError ):
979
981
continue
980
982
@@ -985,8 +987,8 @@ def find_esp32(chip):
985
987
else :
986
988
found_ports .append (port )
987
989
988
- if _esp and _esp ._port :
989
- _esp ._port .close ()
990
+ if _esp and _esp ._port : # NOQA
991
+ _esp ._port .close () # NOQA
990
992
991
993
return found_ports
992
994
@@ -1009,7 +1011,10 @@ def find_esp32(chip):
1009
1011
1010
1012
cmd = cmd .replace ('-p (PORT)' , f'-p "{ PORT } "' )
1011
1013
1012
- erase_flash = f'"{ python_path } " "{ esp_tool_path } " -p "{ PORT } " -b 460800 erase_flash'
1014
+ erase_flash = (
1015
+ f'"{ python_path } " "{ esp_tool_path } " '
1016
+ f'-p "{ PORT } " -b 460800 erase_flash'
1017
+ )
1013
1018
1014
1019
result , _ = spawn (erase_flash )
1015
1020
if result != 0 :
0 commit comments