mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
tools: Make kconfig_new Python3-compatible and enable Python3 in idf.py
This commit is contained in:
parent
91f7a9a9e7
commit
173e6aab3e
@ -389,7 +389,7 @@ test_confserver:
|
|||||||
<<: *host_test_template
|
<<: *host_test_template
|
||||||
script:
|
script:
|
||||||
- cd tools/kconfig_new/test
|
- cd tools/kconfig_new/test
|
||||||
- ./test_confserver.py
|
- ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_confserver.py
|
||||||
|
|
||||||
test_build_system:
|
test_build_system:
|
||||||
<<: *host_test_template
|
<<: *host_test_template
|
||||||
|
@ -43,9 +43,6 @@ tools/kconfig/lxdialog/check-lxdialog.sh
|
|||||||
tools/kconfig/mconf
|
tools/kconfig/mconf
|
||||||
tools/kconfig/merge_config.sh
|
tools/kconfig/merge_config.sh
|
||||||
tools/kconfig/streamline_config.pl
|
tools/kconfig/streamline_config.pl
|
||||||
tools/kconfig_new/confgen.py
|
|
||||||
tools/kconfig_new/confserver.py
|
|
||||||
tools/kconfig_new/test/test_confserver.py
|
|
||||||
tools/mass_mfg/mfg_gen.py
|
tools/mass_mfg/mfg_gen.py
|
||||||
tools/test_idf_monitor/run_test_idf_monitor.py
|
tools/test_idf_monitor/run_test_idf_monitor.py
|
||||||
tools/unit-test-app/unit_test.py
|
tools/unit-test-app/unit_test.py
|
||||||
|
@ -430,7 +430,9 @@ def get_default_serial_port():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
if sys.version_info[0] != 2 or sys.version_info[1] != 7:
|
if sys.version_info[0] != 2 or sys.version_info[1] != 7:
|
||||||
raise FatalError("ESP-IDF currently only supports Python 2.7, and this is Python %d.%d.%d. Search for 'Setting the Python Interpreter' in the ESP-IDF docs for some tips to handle this." % sys.version_info[:3])
|
print("Note: You are using Python %d.%d.%d. Python 3 support is new, please report any problems "
|
||||||
|
"you encounter. Search for 'Setting the Python Interpreter' in the ESP-IDF docs if you want to use "
|
||||||
|
"Python 2.7." % sys.version_info[:3])
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='ESP-IDF build management tool')
|
parser = argparse.ArgumentParser(description='ESP-IDF build management tool')
|
||||||
parser.add_argument('-p', '--port', help="Serial port",
|
parser.add_argument('-p', '--port', help="Serial port",
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
from __future__ import print_function
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
from __future__ import print_function
|
||||||
import os
|
import os
|
||||||
import kconfiglib
|
import kconfiglib
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
from __future__ import print_function
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
@ -6,6 +7,7 @@ import time
|
|||||||
import json
|
import json
|
||||||
import argparse
|
import argparse
|
||||||
import shutil
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
|
||||||
import pexpect
|
import pexpect
|
||||||
|
|
||||||
@ -45,10 +47,10 @@ def main():
|
|||||||
parser.add_argument('--logfile', type=argparse.FileType('w'), help='Optional session log of the interactions with confserver.py')
|
parser.add_argument('--logfile', type=argparse.FileType('w'), help='Optional session log of the interactions with confserver.py')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# set up temporary file to use as sdkconfig copy
|
|
||||||
temp_sdkconfig_path = os.tmpnam()
|
|
||||||
try:
|
try:
|
||||||
with open(temp_sdkconfig_path, "w") as temp_sdkconfig:
|
# set up temporary file to use as sdkconfig copy
|
||||||
|
with tempfile.NamedTemporaryFile(mode="w", delete=False) as temp_sdkconfig:
|
||||||
|
temp_sdkconfig_path = os.path.join(tempfile.gettempdir(), temp_sdkconfig.name)
|
||||||
with open("sdkconfig") as orig:
|
with open("sdkconfig") as orig:
|
||||||
temp_sdkconfig.write(orig.read())
|
temp_sdkconfig.write(orig.read())
|
||||||
|
|
||||||
@ -61,7 +63,7 @@ def main():
|
|||||||
def expect_json():
|
def expect_json():
|
||||||
# run p.expect() to expect a json object back, and return it as parsed JSON
|
# run p.expect() to expect a json object back, and return it as parsed JSON
|
||||||
p.expect("{.+}\r\n")
|
p.expect("{.+}\r\n")
|
||||||
return json.loads(p.match.group(0).strip())
|
return json.loads(p.match.group(0).strip().decode())
|
||||||
|
|
||||||
p.expect("Server running.+\r\n")
|
p.expect("Server running.+\r\n")
|
||||||
initial = expect_json()
|
initial = expect_json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user