Python 3 support (#755)
* Python 3 support * Fix import_vs_environment in xenia-build * Drop support for Python 2 * Fix CIs and xb.bat * Require Python3.4+ because of Ubuntu Trusty * popen.communicate returns bytes instead of string * Useful info in travis * universal_newlines should be True * Changed shebang to python 3 * Python 3 shebang fix * Clang python 3 shebang fix
This commit is contained in:
parent
2a920237dd
commit
882f01533d
|
@ -33,6 +33,7 @@ addons:
|
|||
- clang-3.8
|
||||
- clang-format-3.8
|
||||
- libc++-dev
|
||||
- python3
|
||||
|
||||
git:
|
||||
# We handle submodules ourselves in xenia-build setup.
|
||||
|
@ -43,6 +44,7 @@ before_script:
|
|||
- export CC=clang-3.8
|
||||
# Dump useful info.
|
||||
- $CXX --version
|
||||
- python3 --version
|
||||
# Prepare environment (pull dependencies, build tools).
|
||||
- travis_retry ./xenia-build setup
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
#===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===#
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2015 Ben Vanik. All Rights Reserved.
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""python diff.py file1 file2 diff"""
|
||||
|
||||
import difflib
|
||||
import sys
|
||||
|
||||
|
@ -5,4 +9,4 @@ diff = difflib.unified_diff(
|
|||
open(sys.argv[1]).readlines(),
|
||||
open(sys.argv[2]).readlines())
|
||||
with open(sys.argv[3], 'w') as f:
|
||||
f.write(''.join(diff))
|
||||
f.write(''.join(diff))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2015 Ben Vanik. All Rights Reserved.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2015 Ben Vanik & shuffle2. All Rights Reserved.
|
||||
|
||||
|
|
22
xb.bat
22
xb.bat
|
@ -10,8 +10,8 @@ REM ============================================================================
|
|||
CALL :check_python
|
||||
IF %_RESULT% NEQ 0 (
|
||||
ECHO.
|
||||
ECHO Python 2.7 must be installed and on PATH:
|
||||
ECHO https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi
|
||||
ECHO Python 3.4+ must be installed and on PATH:
|
||||
ECHO https://www.python.org/
|
||||
GOTO :exit_error
|
||||
)
|
||||
|
||||
|
@ -31,13 +31,19 @@ REM ============================================================================
|
|||
:check_python
|
||||
SETLOCAL
|
||||
SET FOUND_PYTHON_EXE=""
|
||||
1>NUL 2>NUL CMD /c where python2
|
||||
1>NUL 2>NUL CMD /c where python3
|
||||
IF NOT ERRORLEVEL 1 (
|
||||
ECHO FOUND PYTHON 2
|
||||
SET FOUND_PYTHON_EXE=python2
|
||||
SET FOUND_PYTHON_EXE=python3
|
||||
)
|
||||
IF %FOUND_PYTHON_EXE% EQU "" (
|
||||
IF EXIST c:\\python27\\python.exe SET FOUND_PYTHON_EXE=C:\\python27\\python.exe
|
||||
IF EXIST c:\\python34\\python.exe SET FOUND_PYTHON_EXE=C:\\python34\\python.exe
|
||||
)
|
||||
IF %FOUND_PYTHON_EXE% EQU "" (
|
||||
IF EXIST c:\\python35\\python.exe SET FOUND_PYTHON_EXE=C:\\python35\\python.exe
|
||||
)
|
||||
IF %FOUND_PYTHON_EXE% EQU "" (
|
||||
IF EXIST c:\\python36\\python.exe SET FOUND_PYTHON_EXE=C:\\python36\\python.exe
|
||||
)
|
||||
IF %FOUND_PYTHON_EXE% EQU "" (
|
||||
1>NUL 2>NUL CMD /c where python
|
||||
|
@ -47,13 +53,13 @@ IF %FOUND_PYTHON_EXE% EQU "" (
|
|||
)
|
||||
IF %FOUND_PYTHON_EXE% EQU "" (
|
||||
ECHO ERROR: no Python executable found on PATH.
|
||||
ECHO Make sure you can run 'python' or 'python2' in a Command Prompt.
|
||||
ECHO Make sure you can run 'python' or 'python3' in a Command Prompt.
|
||||
ENDLOCAL & SET _RESULT=1
|
||||
GOTO :eof
|
||||
)
|
||||
CMD /C %FOUND_PYTHON_EXE% -c "import sys; sys.exit(1 if not sys.version_info[:2] == (2, 7) else 0)"
|
||||
CMD /C %FOUND_PYTHON_EXE% -c "import sys; sys.exit(1 if not sys.version_info[:2] >= (3, 4) else 0)"
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
ECHO ERROR: Python version mismatch - not 2.7
|
||||
ECHO ERROR: Python version mismatch - not 3.4+
|
||||
ENDLOCAL & SET _RESULT=1
|
||||
GOTO :eof
|
||||
)
|
||||
|
|
2246
xenia-build
2246
xenia-build
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue