Skip to content

Commit

Permalink
3.13 support (#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
clin1234 authored Jun 17, 2024
1 parent f82f936 commit 7e8d26b
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 22 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
architecture: ["x64", "x86"]

steps:
Expand All @@ -30,6 +30,7 @@ jobs:
architecture: ${{ matrix.architecture }}
cache: pip
cache-dependency-path: .github/workflows/main.yml
check-latest: true

- name: Setup environment
run: |
Expand Down Expand Up @@ -66,8 +67,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12-dev"]

python-version: ["3.10", "3.11", "3.12", "3.13-dev"]
steps:
- uses: actions/checkout@v4

Expand All @@ -78,6 +78,7 @@ jobs:
architecture: "x64"
cache: pip
cache-dependency-path: .github/workflows/main.yml
check-latest: true

- name: Setup Environment
run: |
Expand Down Expand Up @@ -137,6 +138,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: .github/workflows/main.yml
check-latest: true
- run: pip install types-regex types-setuptools mypy==1.9
- run: mypy . --python-version=${{ matrix.python-version }}

Expand All @@ -145,14 +147,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: .github/workflows/main.yml
check-latest: true
# pyright vendors typeshed, but let's make sure we have the most up to date stubs
- run: pip install types-regex types-setuptools
- uses: jakebailey/pyright-action@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ venv.bak/
.idea/
.DS_Store
vagrant_helpers/bootstrap-salt.ps1
.vscode/
2 changes: 1 addition & 1 deletion Pythonwin/win32thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ unsigned int ThreadWorkerEntryPoint(LPVOID lpvoid)
{
CPythonWinThread *pThis = (CPythonWinThread *)lpvoid;
CEnterLeavePython _celp;
PyObject *result = PyEval_CallObject(pThis->obFunc, pThis->obArgs);
PyObject *result = PyObject_CallObject(pThis->obFunc, pThis->obArgs);
if (result == NULL) {
if (PyErr_Occurred() == PyExc_SystemExit)
PyErr_Clear();
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/win32uimodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ static DWORD FilterFunc(DWORD dwExceptionCode)
return (dwRet);
}

PyObject *gui_call_object(PyObject *themeth, PyObject *thearglst) { return PyEval_CallObject(themeth, thearglst); }
PyObject *gui_call_object(PyObject *themeth, PyObject *thearglst) { return PyObject_CallObject(themeth, thearglst); }

void gui_print_error(void)
{
Expand Down
24 changes: 18 additions & 6 deletions adodbapi/test/adodbapitest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1546,17 +1546,29 @@ def testTimestamp(self):
assert t1 < obj < t2, obj


suites = [unittest.makeSuite(TestPythonDateTimeConverter, "test")]
suites = [
unittest.defaultTestLoader.loadTestsFromModule(TestPythonDateTimeConverter, "test")
]
if config.doTimeTest:
suites.append(unittest.makeSuite(TestPythonTimeConverter, "test"))
suites.append(
unittest.defaultTestLoader.loadTestsFromModule(TestPythonTimeConverter, "test")
)
if config.doAccessTest:
suites.append(unittest.makeSuite(TestADOwithAccessDB, "test"))
suites.append(
unittest.defaultTestLoader.loadTestsFromModule(TestADOwithAccessDB, "test")
)
if config.doSqlServerTest:
suites.append(unittest.makeSuite(TestADOwithSQLServer, "test"))
suites.append(
unittest.defaultTestLoader.loadTestsFromModule(TestADOwithSQLServer, "test")
)
if config.doMySqlTest:
suites.append(unittest.makeSuite(TestADOwithMySql, "test"))
suites.append(
unittest.defaultTestLoader.loadTestsFromModule(TestADOwithMySql, "test")
)
if config.doPostgresTest:
suites.append(unittest.makeSuite(TestADOwithPostgres, "test"))
suites.append(
unittest.defaultTestLoader.loadTestsFromModule(TestADOwithPostgres, "test")
)


class cleanup_manager:
Expand Down
4 changes: 4 additions & 0 deletions build_all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ py -3.12-32 setup.py -q build
@if errorlevel 1 goto failed
py -3.12 setup.py -q build
@if errorlevel 1 goto failed
py -3.13-32 setup.py -q build
@if errorlevel 1 goto failed
py -3.13 setup.py -q build
@if errorlevel 1 goto failed

goto xit
:failed
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/src/oleargs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ BOOL PyCom_MakeOlePythonCall(PyObject *handler, DISPPARAMS FAR *params, VARIANT
argList = Py_BuildValue("OO", varArgs, addnlArgs);
Py_DECREF(varArgs);
}
PyObject *result = PyEval_CallObject(handler, argList);
PyObject *result = PyObject_CallObject(handler, argList);
Py_XDECREF(argList);
Py_XDECREF(namedArgList);
// handlers reference cleaned up by virtual manager.
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/src/univgw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static HRESULT univgw_dispatch(DWORD index, gw_object *_this, va_list argPtr)
PyTuple_SET_ITEM(obArgs, 2, obArgPtr);

// call the provided method
PyObject *result = PyEval_CallObjectWithKeywords(vtbl->dispatcher, obArgs, NULL);
PyObject *result = PyObject_CallObject(vtbl->dispatcher, obArgs);

// done with the arguments and the contained objects
Py_DECREF(obArgs);
Expand Down
2 changes: 1 addition & 1 deletion com/win32com/test/testIterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def suite():
and issubclass(item, unittest.TestCase)
and item != _BaseTestCase
):
suite.addTest(unittest.makeSuite(item))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(item))
return suite


Expand Down
2 changes: 1 addition & 1 deletion com/win32comext/shell/src/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ static int CALLBACK PyBrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LP
#endif
if (!args)
goto done;
result = PyEval_CallObject(pc->fn, args);
result = PyObject_CallObject(pc->fn, args);
// API says must return 0, but there might be a good reason.
if (result && PyLong_Check(result))
rc = PyLong_AsLong(result);
Expand Down
5 changes: 5 additions & 0 deletions make_all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@ py -3.9 setup.py -q bdist_wininst --skip-build --target-version=3.12
py -3.12-32 setup.py -q bdist_wheel --skip-build
py -3.12 setup.py -q bdist_wheel --skip-build

py -3.9 setup.py -q bdist_wininst --skip-build --target-version=3.13
py -3.13-32 setup.py -q bdist_wheel --skip-build
py -3.13 setup.py -q bdist_wheel --skip-build

rem ARM64 builds - requires you to select:
rem * "Visual C++ compilers and libraries for ARM64"
rem * "Visual C++ for MFC for ARM64"
rem from "Individual Components" in VS setup.
py -3.10 setup.py -q build_ext --plat-name win-arm64 build --plat-name win-arm64 bdist_wheel --plat-name win-arm64
py -3.11 setup.py -q build_ext --plat-name win-arm64 build --plat-name win-arm64 bdist_wheel --plat-name win-arm64
py -3.12 setup.py -q build_ext --plat-name win-arm64 build --plat-name win-arm64 bdist_wheel --plat-name win-arm64
py -3.13 setup.py -q build_ext --plat-name win-arm64 build --plat-name win-arm64 bdist_wheel --plat-name win-arm64

@goto xit
:couldnt_rm
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2207,6 +2207,7 @@ def convert_optional_data_files(files):
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
]

Expand Down
2 changes: 1 addition & 1 deletion win32/src/PyTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ PyObject *PyWin_NewTime(PyObject *timeOb)
if (method == NULL)
PyErr_Clear();
else {
timeOb = PyEval_CallObject(method, NULL);
timeOb = PyObject_CallObject(method, NULL);
Py_DECREF(method);
if (!timeOb)
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion win32/src/timermodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ VOID CALLBACK py_win32_timer_callback(HWND hwnd, UINT msg, UINT_PTR timer_id, DW
// the callback itself removes the function from the map.
Py_INCREF(callback_function);
PyObject *callback_args = Py_BuildValue("(Ok)", py_timer_id, time);
PyObject *result = PyEval_CallObject(callback_function, callback_args);
PyObject *result = PyObject_CallObject(callback_function, callback_args);

if (!result) {
// Is this necessary, or will python already have flagged
Expand Down
2 changes: 1 addition & 1 deletion win32/src/win32gui.i
Original file line number Diff line number Diff line change
Expand Up @@ -6065,7 +6065,7 @@ static int CALLBACK PySortFunc(
assert(!PyErr_Occurred());
args = Py_BuildValue("llO", lParam1, lParam2, pc->data);
if (!args) goto done;
result = PyEval_CallObject(pc->fn, args);
result = PyObject_CallObject(pc->fn, args);
// API says must return 0, but there might be a good reason.
if (!result) goto done;
if (!PyLong_Check(result)) {
Expand Down
2 changes: 1 addition & 1 deletion win32/src/win32pdhmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ PDH_STATUS __stdcall PyCounterPathCallback(DWORD_PTR dwArg)
rc = ERROR_OUTOFMEMORY;
}
else {
result = PyEval_CallObject(pMy->func, args);
result = PyObject_CallObject(pMy->func, args);
if (result == NULL) {
PyErr_Print(); // *Don't* leave exception hanging
rc = PDH_INVALID_DATA;
Expand Down
2 changes: 1 addition & 1 deletion win32/src/win32process.i
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ unsigned __stdcall ThreadEntryPoint( void *arg )
{
CEnterLeavePython _celp;
PythonThreadData *ptd = (PythonThreadData *)arg;
PyObject *pyrc = PyEval_CallObject(ptd->m_obFunc, ptd->m_obArgs);
PyObject *pyrc = PyObject_CallObject(ptd->m_obFunc, ptd->m_obArgs);
delete ptd;
if (pyrc==NULL) {
fprintf(stderr, "Unhandled exception in beginthreadex created thread:\n");
Expand Down
2 changes: 1 addition & 1 deletion win32/src/win32rasmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ VOID CALLBACK PyRasDialFunc1(HRASCONN hrasconn, // handle to RAS connection
PyObject *args = Py_BuildValue("Niiii", PyWinLong_FromHANDLE(hrasconn), unMsg, rascs, dwError, dwExtendedError);
if (args == NULL)
return;
PyObject *res = PyEval_CallObject(handler, args);
PyObject *res = PyObject_CallObject(handler, args);
Py_DECREF(args);
if (res == NULL) {
PyErr_Print();
Expand Down

0 comments on commit 7e8d26b

Please sign in to comment.