Skip to content

Commit 7e4d587

Browse files
committed
Add Python 3 support on Windows (#121)...
Tested using Python 3.4 / 3.5 / 3.6. Only 32-bit. Everything works good. Update tools for Python 3. On Windows build.py tool will call build_cpp_projects.py to build C++ projects. On Linux and Mac C++ projects are built using Makefiles. There are still deprecated .vcproj files across directories, however they are all deprecated and not used anymore. automate.py --prebuilt-cef works on Python 3. However --build-cef depends on upstream automate-git.py which supports only Python 2. Minor fixes to build instructions.
1 parent ae2727f commit 7e4d587

8 files changed

+312
-249
lines changed

docs/Build-instructions.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ and libraries from GitHub Releases:
5555
2) Download [ninja](https://github.com/ninja-build/ninja) 1.7.2 or later
5656
and add it to PATH.
5757

58-
3) Download [cmake](https://cmake.org/download/) 3.7.2 or later and add
58+
3) Download [cmake](https://cmake.org/download/) and add
5959
it to PATH.
6060

6161
4) For Python 2.7 Install "Visual C++ Compiler for Python 2.7"
@@ -147,6 +147,9 @@ requirements common for all platforms.
147147

148148
### Windows
149149

150+
* Download [ninja](https://github.com/ninja-build/ninja) 1.7.2 or later
151+
and add it to PATH.
152+
* Download [cmake](https://cmake.org/download/) and add it to PATH.
150153
* Install an appropriate MS compiler for a specific Python version:
151154
https://wiki.python.org/moin/WindowsCompilers
152155
* For Python 2.7 install "Microsoft Visual C++ Compiler for Python 2.7"
@@ -208,6 +211,10 @@ requirements common for all platforms.
208211

209212
* MacOS 10.9+, Xcode5+ and Xcode command line tools. Only 64-bit builds
210213
are supported.
214+
* Download [ninja](https://github.com/ninja-build/ninja) 1.7.2 or later
215+
and add it to PATH.
216+
* Download [cmake](https://cmake.org/download/) and add it to PATH.
217+
211218

212219

213220
### All platforms

src/compile_time_constants.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# This file was generated by setup.py
22
DEF UNAME_SYSNAME = "Windows"
3-
DEF PY_MAJOR_VERSION = 3
3+
DEF PY_MAJOR_VERSION = 2

tools/apidocs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def api_index():
3636
if "API-" in file_:
3737
continue
3838
with open(file_, "rb") as fo:
39-
raw_mdcontents = fo.read()
39+
raw_mdcontents = fo.read().decode("utf-8")
4040

4141
parsable_mdcontents = re.sub(r"```[\s\S]+?```", "", raw_mdcontents)
4242
allmatches = re.findall(r"^(#|###)\s+(.*)", parsable_mdcontents,
@@ -58,7 +58,7 @@ def api_index():
5858
contents += (indent + "* " + "[%s](%s)\n" % (title, link))
5959
indexfile = os.path.join(API_DIR, "API-index.md")
6060
with open(indexfile, "wb") as fo:
61-
fo.write(contents)
61+
fo.write(contents.encode("utf-8"))
6262
print("Created %s in %s" % (os.path.basename(indexfile), API_DIR))
6363
print("Done")
6464

0 commit comments

Comments
 (0)