Skip to content

Commit dd99da7

Browse files
committed
WIP
1 parent 2665943 commit dd99da7

9 files changed

Lines changed: 27 additions & 23 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: windows-2022
2424
strategy:
2525
matrix:
26-
python-version: [ 3.14 ]
26+
python-version: [ 3.13, 3.14 ]
2727

2828
steps:
2929

@@ -35,11 +35,14 @@ jobs:
3535
python-version: ${{ matrix.python-version }}
3636

3737
- name: Show Python build paths
38+
shell: cmd
3839
run: |
3940
python -c "import sys, sysconfig; print(sys.executable); print(sys.version)"
4041
python -c "import sysconfig; print('include=', sysconfig.get_paths()['include'])"
4142
python -c "import sysconfig; print('platinclude=', sysconfig.get_paths().get('platinclude'))"
4243
python -c "import sysconfig; print('EXT_SUFFIX=', sysconfig.get_config_var('EXT_SUFFIX'))"
44+
for /f "delims=" %%I in ('python -c "import sysconfig; print(sysconfig.get_paths()[\"include\"]) "') do echo PL_PYTHON_INCLUDES=%%I>>"%GITHUB_ENV%"
45+
for /f "delims=" %%I in ('python -c "import sys, os; print(os.path.join(sys.base_prefix, 'libs'))"') do echo PL_PYTHON_LIBS=%%I>>"%GITHUB_ENV%"
4346
4447
- name: Install Dependencies
4548
run: |
@@ -56,6 +59,7 @@ jobs:
5659
shell: cmd
5760
run: |
5861
set VULKAN_SDK=D:/a/VulkanSDK
62+
echo "%PL_PYTHON_INCLUDES%"
5963
cd %GITHUB_WORKSPACE%
6064
cd scripts
6165
python gen_build.py
@@ -83,7 +87,7 @@ jobs:
8387
CXX: g++-10
8488
strategy:
8589
matrix:
86-
python-version: ["3.12"]
90+
python-version: ["3.13", "3.14"]
8791

8892
steps:
8993

@@ -101,14 +105,7 @@ jobs:
101105
python -c "import sysconfig; print('include=', sysconfig.get_paths()['include'])"
102106
python -c "import sysconfig; print('platinclude=', sysconfig.get_paths().get('platinclude'))"
103107
python -c "import sysconfig; print('EXT_SUFFIX=', sysconfig.get_config_var('EXT_SUFFIX'))"
104-
105-
- name: Show Python build paths 2
106-
run: |
107-
cd /opt/hostedtoolcache/Python/3.12.12/x64
108-
ls
109-
cd include
110-
cd python3.12
111-
ls
108+
echo "PL_PYTHON_INCLUDES=$(python -c 'import sysconfig; print(sysconfig.get_paths()["include"])')" >> "$GITHUB_ENV"
112109
113110
- name: Install Dependencies
114111
run: |
@@ -137,6 +134,7 @@ jobs:
137134
- name: Build Package
138135
run: |
139136
cd $GITHUB_WORKSPACE
137+
echo "$PL_PYTHON_INCLUDES"
140138
cd scripts
141139
python3 gen_build.py
142140
cd ../src

scripts/gen_build.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,11 @@
289289
with pl.platform("Windows"):
290290
with pl.compiler("msvc"):
291291

292-
pl.add_include_directories("C:/hostedtoolcache/windows/Python/3.14.3/x64/Include")
293-
pl.add_link_directories("C:/hostedtoolcache/windows/Python/3.14.3/x64/libs")
292+
# pl.add_include_directories("C:/hostedtoolcache/windows/Python/3.14.3/x64/Include")
293+
# pl.add_link_directories("C:/hostedtoolcache/windows/Python/3.14.3/x64/libs")
294+
295+
pl.add_include_directories("%PL_PYTHON_INCLUDES%")
296+
pl.add_link_directories("%PL_PYTHON_LIBS%")
294297

295298
pl.add_definitions("PL_VULKAN_BACKEND")
296299
pl.add_include_directories("%VULKAN_SDK%\\Include")
@@ -307,8 +310,11 @@
307310
with pl.platform("Linux"):
308311
with pl.compiler("gcc"):
309312

310-
pl.add_include_directories("/opt/hostedtoolcache/Python/3.12.12/x64/include/python3.12")
311-
pl.add_link_directories("/opt/hostedtoolcache/Python/3.12.12/x64/libs")
313+
# pl.add_include_directories("/opt/hostedtoolcache/Python/3.12.12/x64/include/python3.12")
314+
# pl.add_link_directories("/opt/hostedtoolcache/Python/3.12.12/x64/libs")
315+
316+
pl.add_include_directories("$PL_PYTHON_INCLUDES")
317+
# pl.add_link_directories("/opt/hostedtoolcache/Python/3.12.12/x64/libs")
312318

313319
pl.add_definitions("PL_VULKAN_BACKEND")
314320
pl.add_include_directories('$VULKAN_SDK/include', '/usr/include/vulkan')

src/m_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plIOI_is_key_pressed(PyObject* self, PyObject* args, PyObject* kwargs)
1313

1414
int iKey = 0;
1515

16-
if (!pl_parse("i|", (char**)apcKeywords, args, kwargs, __FUNCTION__, &iKey))
16+
if (!pl_parse("i|", (const char**)apcKeywords, args, kwargs, __FUNCTION__, &iKey))
1717
return NULL;
1818

1919
bool bResult = gptIOI->is_key_pressed(iKey, true);

src/m_draw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ plDrawI_add_triangle_filled(PyObject* self, PyObject* args, PyObject* kwargs)
6969
NULL,
7070
};
7171

72-
if (!pl_parse("OOOO|$I", (char**)apcKeywords, args, kwargs, __FUNCTION__,
72+
if (!pl_parse("OOOO|$I", (const char**)apcKeywords, args, kwargs, __FUNCTION__,
7373
&ptPythonLayer, &ptPythonP0, &ptPythonP1, &ptPythonP2, &uColor))
7474
return NULL;
7575

src/m_starter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plStarterI_initialize(PyObject* self, PyObject* args, PyObject* kwargs)
1111
NULL,
1212
};
1313

14-
if (!pl_parse("O|", (char**)apcKeywords, args, kwargs, __FUNCTION__, &ptWindow))
14+
if (!pl_parse("O|", (const char**)apcKeywords, args, kwargs, __FUNCTION__, &ptWindow))
1515
return NULL;
1616

1717
plWindow* ptWindowPtr = PyCapsule_GetPointer(ptWindow, "plWindow");

src/m_ui.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plUiI_begin_window(PyObject* self, PyObject* args, PyObject* kwargs)
1212
NULL,
1313
};
1414

15-
if (!pl_parse("s|", (char**)apcKeywords, args, kwargs, __FUNCTION__, &pcText))
15+
if (!pl_parse("s|", (const char**)apcKeywords, args, kwargs, __FUNCTION__, &pcText))
1616
return NULL;
1717
return PyBool_FromLong(gptUI->begin_window(pcText, NULL, 0));
1818
}
@@ -36,7 +36,7 @@ plUiI_button(PyObject* self, PyObject* args, PyObject* kwargs)
3636
NULL,
3737
};
3838

39-
if (!pl_parse("s|", (char**)apcKeywords,
39+
if (!pl_parse("s|", (const char**)apcKeywords,
4040
args, kwargs, __FUNCTION__, &pcText))
4141
return NULL;
4242

src/m_unity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
#define PL_UNITY_BUILD
88
#include "pl_unity_ext.c"
99

10-
bool pl_parse(char* formatstring, char* const* keywords, PyObject* args, PyObject* kwargs, const char* message, ...);
10+
bool pl_parse(char* formatstring, const char** keywords, PyObject* args, PyObject* kwargs, const char* message, ...);
1111

1212
#endif // M_UNITY_H

src/m_vfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plVfsI_mount_directory(PyObject* self, PyObject* args, PyObject* kwargs)
1313
const char* pcDirectory = NULL;
1414
const char* pcPhysicalDirectory = NULL;
1515

16-
if (!pl_parse("ss|", (char**)apcKeywords, args, kwargs, __FUNCTION__, &pcDirectory, &pcPhysicalDirectory))
16+
if (!pl_parse("ss|", (const char**)apcKeywords, args, kwargs, __FUNCTION__, &pcDirectory, &pcPhysicalDirectory))
1717
return NULL;
1818

1919
gptVfs->mount_directory(pcDirectory, pcPhysicalDirectory, PL_VFS_MOUNT_FLAGS_NONE);

src/pilotlight.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ PyInit_pilotlight(void)
289289
}
290290

291291
bool
292-
pl_parse(char* formatstring, char* const* keywords, PyObject* args, PyObject* kwargs, const char* message, ...)
292+
pl_parse(char* formatstring, const char** keywords, PyObject* args, PyObject* kwargs, const char* message, ...)
293293
{
294294

295295
bool check = true;
296296

297297
va_list arguments;
298298
va_start(arguments, message);
299-
if (!PyArg_VaParseTupleAndKeywords(args, kwargs, formatstring, keywords, arguments))
299+
if (!PyArg_VaParseTupleAndKeywords(args, kwargs, formatstring, (char * const *)keywords, arguments))
300300
{
301301
check = false;
302302
}

0 commit comments

Comments
 (0)