Skip to content

Commit ec046c0

Browse files
authored
Merge pull request #9 from tango-controls/python3.13
Update boost to 1.86.0 and add Python 3.13
2 parents 5939ed6 + 82ee1c8 commit ec046c0

File tree

2 files changed

+63
-2
lines changed

2 files changed

+63
-2
lines changed

appveyor.yml

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: 1.0.{build}
22

33
environment:
4-
BOOST_VERSION: "1.85.0"
5-
BOOST_VERSION_UNDERSCORED: "1_85_0"
4+
BOOST_VERSION: "1.86.0"
5+
BOOST_VERSION_UNDERSCORED: "1_86_0"
66
matrix:
77
# Python 3.9
88
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
@@ -86,6 +86,28 @@ environment:
8686
BOOST_CFG: >-
8787
using python : 3.12 : c:/python312-x64/python.exe : c:/python312-x64/include : c:/python312-x64/libs ;
8888
89+
# Python 3.13
90+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
91+
platform: win32
92+
ADDR_MODEL: 32
93+
ARCH: v142_x86
94+
MSVCVERSION: 14.2
95+
PYTHON_DOWNLOAD_URL: https://www.python.org/ftp/python/3.13.0/python-3.13.0.exe
96+
PYTHONPATH: c:\Python313\
97+
PY_VER: 313
98+
BOOST_CFG: >-
99+
using python : 3.13 : c:/python313/python.exe : c:/python313/include : c:/python313/libs ;
100+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
101+
platform: x64
102+
ADDR_MODEL: 64
103+
ARCH: v142_x64
104+
MSVCVERSION: 14.2
105+
PYTHON_DOWNLOAD_URL: https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe
106+
PYTHONPATH: c:\Python313-x64\
107+
PY_VER: 313
108+
BOOST_CFG: >-
109+
using python : 3.13 : c:/python313-x64/python.exe : c:/python313-x64/include : c:/python313-x64/libs ;
110+
89111
init:
90112
#RDP from start
91113
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
@@ -121,6 +143,7 @@ install:
121143
}
122144
# apply patches to Boost
123145
- cmd: patch -uN C:/projects/boost_build/boost_%BOOST_VERSION_UNDERSCORED%/libs/python/src/numpy/dtype.cpp C:/projects/boost-ci/patches/support-numpy-2.0.0b1.patch
146+
- cmd: patch -uN C:/projects/boost_build/boost_%BOOST_VERSION_UNDERSCORED%/libs/python/src/numpy/dtype.cpp C:/projects/boost-ci/patches/0003-Support-numpy-2.0.patch
124147
# building bootstrap
125148
- cmd: cd C:/projects/boost_build/boost_%BOOST_VERSION_UNDERSCORED%
126149
- cmd: C:/projects/boost_build/boost_%BOOST_VERSION_UNDERSCORED%/bootstrap.bat

patches/0003-Support-numpy-2.0.patch

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/libs/python/src/numpy/dtype.cpp b/libs/python/src/numpy/dtype.cpp
2+
index da30d192..1ce8c6ec 100644
3+
--- a/libs/python/src/numpy/dtype.cpp
4+
+++ b/libs/python/src/numpy/dtype.cpp
5+
@@ -107,32 +107,7 @@ int dtype::get_itemsize() const {
6+
}
7+
8+
bool equivalent(dtype const & a, dtype const & b) {
9+
- // On Windows x64, the behaviour described on
10+
- // http://docs.scipy.org/doc/numpy/reference/c-api.array.html for
11+
- // PyArray_EquivTypes unfortunately does not extend as expected:
12+
- // "For example, on 32-bit platforms, NPY_LONG and NPY_INT are equivalent".
13+
- // This should also hold for 64-bit platforms (and does on Linux), but not
14+
- // on Windows. Implement an alternative:
15+
-#ifdef _MSC_VER
16+
- if (sizeof(long) == sizeof(int) &&
17+
- // Manually take care of the type equivalence.
18+
- ((a == dtype::get_builtin<long>() || a == dtype::get_builtin<int>()) &&
19+
- (b == dtype::get_builtin<long>() || b == dtype::get_builtin<int>()) ||
20+
- (a == dtype::get_builtin<unsigned int>() || a == dtype::get_builtin<unsigned long>()) &&
21+
- (b == dtype::get_builtin<unsigned int>() || b == dtype::get_builtin<unsigned long>()))) {
22+
- return true;
23+
- } else {
24+
- return PyArray_EquivTypes(
25+
- reinterpret_cast<PyArray_Descr*>(a.ptr()),
26+
- reinterpret_cast<PyArray_Descr*>(b.ptr())
27+
- );
28+
- }
29+
-#else
30+
- return PyArray_EquivTypes(
31+
- reinterpret_cast<PyArray_Descr*>(a.ptr()),
32+
- reinterpret_cast<PyArray_Descr*>(b.ptr())
33+
- );
34+
-#endif
35+
+ return a == b;
36+
}
37+
38+
namespace

0 commit comments

Comments
 (0)