Skip to content

Commit 99dafa7

Browse files
committed
bump versions in requirements and add support for python 3.12
1 parent f4f68d8 commit 99dafa7

11 files changed

Lines changed: 31 additions & 35 deletions

src/common/cefpython_public_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
#include "../../build/build_cefpython/cefpython_py310_fixed.h"
5656
#elif PY_MINOR_VERSION == 11
5757
#include "../../build/build_cefpython/cefpython_py311_fixed.h"
58+
#elif PY_MINOR_VERSION == 12
59+
#include "../../build/build_cefpython/cefpython_py312_fixed.h"
5860
#endif // PY_MINOR_VERSION
5961
#endif // PY_MAJOR_VERSION
6062

src/extern/multimap.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cdef extern from "<map>" namespace "std":
1515
iterator operator--() nogil
1616
bint operator==(iterator) nogil
1717
bint operator!=(iterator) nogil
18-
multimap() nogil except +
18+
multimap() except + nogil
1919
# noinspection PyUnresolvedReferences
2020
U& operator[](T&) nogil
2121
# noinspection PyUnresolvedReferences

src/extern/wstring.pxd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ cdef extern from "<string>" namespace "std":
1212
size_t npos = -1
1313

1414
cdef cppclass wstring:
15-
wstring() nogil except +
16-
wstring(wchar_t *) nogil except +
17-
wstring(wchar_t *, size_t) nogil except +
18-
wstring(string&) nogil except +
15+
wstring() except + nogil
16+
wstring(wchar_t *) except + nogil
17+
wstring(wchar_t *, size_t) except + nogil
18+
wstring(string&) except + nogil
1919
# as a string formed by a repetition of character c, n times.
20-
wstring(size_t, char) nogil except +
20+
wstring(size_t, char) except + nogil
2121

2222
const_wchar_t* c_str() nogil
2323
const_wchar_t* data() nogil

tools/build.py

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,6 @@ def fix_cefpython_api_header_file():
379379
with open(CEFPYTHON_API_HFILE, "rb") as fo:
380380
contents = fo.read().decode("utf-8")
381381

382-
# Pragma fix on Windows
383-
if WINDOWS:
384-
pragma = "#pragma warning(disable:4190)"
385-
if pragma in contents:
386-
print("[build.py] cefpython API header file is already fixed")
387-
else:
388-
contents = ("%s\n\n" % pragma) + contents
389-
with open(CEFPYTHON_API_HFILE, "wb") as fo:
390-
fo.write(contents.encode("utf-8"))
391-
print("[build.py] Save {filename}"
392-
.format(filename=CEFPYTHON_API_HFILE))
393-
394382
# Make a copy with a "_fixed" postfix
395383
if os.path.exists(CEFPYTHON_API_HFILE_FIXED):
396384
with open(CEFPYTHON_API_HFILE_FIXED, "rb") as fo:
@@ -736,23 +724,23 @@ def except_all_missing(content):
736724
patterns = list()
737725
patterns.append(
738726
r"\bcp?def\s+"
739-
"((int|short|long|double|char|unsigned|float|double|cpp_bool"
740-
"|cpp_string|cpp_wstring|uintptr_t|void"
741-
"|int32|uint32|int64|uint64"
742-
"|int32_t|uint32_t|int64_t|uint64_t"
743-
"|CefString)\s+)+"
744-
"\w+\([^)]*\)\s*(with\s+(gil|nogil))?\s*:")
727+
r"((int|short|long|double|char|unsigned|float|double|cpp_bool"
728+
r"|cpp_string|cpp_wstring|uintptr_t|void"
729+
r"|int32|uint32|int64|uint64"
730+
r"|int32_t|uint32_t|int64_t|uint64_t"
731+
r"|CefString)\s+)+"
732+
r"\w+\([^)]*\)\s*(with\s+(gil|nogil))?\s*:")
745733
patterns.append(
746734
r"\bcp?def\s+"
747735
# A template ends with bracket: CefRefPtr[CefBrowser]
748736
# or a pointer ends with asterisk: CefBrowser*
749-
"[^\s]+[\]*]\s+"
750-
"\w+\([^)]*\)\s*(with\s+(gil|nogil))?\s*:")
737+
r"[^\s]+[\]*]\s+"
738+
r"\w+\([^)]*\)\s*(with\s+(gil|nogil))?\s*:")
751739
patterns.append(
752740
r"\bcp?def\s+"
753741
# A reference, eg. CefString&
754-
"[^\s]+&\s+"
755-
"\w+\([^)]*\)\s*(with\s+(gil|nogil))?\s*:")
742+
r"[^\s]+&\s+"
743+
r"\w+\([^)]*\)\s*(with\s+(gil|nogil))?\s*:")
756744

757745
match = None
758746
for pattern in patterns:

tools/build_distrib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
ALLOW_PARTIAL = False
8181

8282
# Python versions
83-
SUPPORTED_PYTHON_VERSIONS = [(2, 7), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3.10), (3.11)]
83+
SUPPORTED_PYTHON_VERSIONS = [(2, 7), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3.10), (3.11), (3.12)]
8484

8585
# Python search paths. It will use first Python found for specific version.
8686
# Supports replacement of one environment variable in path eg.: %ENV_KEY%.
@@ -615,7 +615,7 @@ def check_cpp_extension_dependencies_issue359(setup_dir, all_pythons):
615615
return
616616
checked_any = False
617617
for python in all_pythons:
618-
if python["version2"] in ((3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10), (3, 11)):
618+
if python["version2"] in ((3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10), (3, 11), (3.12)):
619619
checked_any = True
620620
if not os.path.exists(os.path.join(setup_dir, "cefpython3",
621621
"msvcp140.dll")):

tools/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@ def get_msvs_for_python(vs_prefix=False):
492492
return "VS2019" if vs_prefix else "2019"
493493
elif sys.version_info[:2] == (3, 11):
494494
return "VS2022" if vs_prefix else "2022"
495+
elif sys.version_info[:2] == (3, 12):
496+
return "VS2022" if vs_prefix else "2022"
495497
else:
496498
print("ERROR: This version of Python is not supported")
497499
sys.exit(1)

tools/cython_setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ def get_ext_modules(options):
439439
"c_string_encoding": "utf-8",
440440
"profile": ENABLE_PROFILING,
441441
"linetrace": ENABLE_LINE_TRACING,
442+
"show_performance_hints": False,
442443
},
443444

444445
language="c++",

tools/installer/cefpython3.__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,7 @@
6767
from . import cefpython_py310 as cefpython
6868
elif sys.version_info[:2] == (3, 11):
6969
from . import cefpython_py311 as cefpython
70+
elif sys.version_info[:2] == (3, 12):
71+
from . import cefpython_py312 as cefpython
7072
else:
7173
raise Exception("Python version not supported: " + sys.version)

tools/installer/cefpython3.setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def main():
150150
"Programming Language :: Python :: 3.9",
151151
"Programming Language :: Python :: 3.10",
152152
"Programming Language :: Python :: 3.11",
153+
"Programming Language :: Python :: 3.12",
153154
"Topic :: Desktop Environment",
154155
"Topic :: Internet",
155156
"Topic :: Internet :: WWW/HTTP",

tools/make_installer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ def copy_cpp_extension_dependencies_issue359(pkg_dir):
371371
or os.path.exists(os.path.join(pkg_dir, "cefpython_py38.pyd")) \
372372
or os.path.exists(os.path.join(pkg_dir, "cefpython_py39.pyd")) \
373373
or os.path.exists(os.path.join(pkg_dir, "cefpython_py310.pyd")) \
374-
or os.path.exists(os.path.join(pkg_dir, "cefpython_py311.pyd")):
374+
or os.path.exists(os.path.join(pkg_dir, "cefpython_py311.pyd")) \
375+
or os.path.exists(os.path.join(pkg_dir, "cefpython_py312.pyd")):
375376
search_paths = [
376377
# This is where Microsoft Visual C++ 2015 Update 3 installs
377378
# (14.00.24212).

0 commit comments

Comments
 (0)