Skip to content

Commit 2665943

Browse files
committed
WIP
1 parent b3623c0 commit 2665943

File tree

6 files changed

+60
-16
lines changed

6 files changed

+60
-16
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ on:
66

77
inputs:
88

9-
version:
10-
description: 'pilotlight version'
11-
required: true
12-
default: '0.1.0'
13-
149
deploy:
1510
description: 'Deploy (true will deploy to pypi)'
1611
required: true
@@ -88,7 +83,7 @@ jobs:
8883
CXX: g++-10
8984
strategy:
9085
matrix:
91-
python-version: ["3.14"]
86+
python-version: ["3.12"]
9287

9388
steps:
9489

@@ -107,6 +102,14 @@ jobs:
107102
python -c "import sysconfig; print('platinclude=', sysconfig.get_paths().get('platinclude'))"
108103
python -c "import sysconfig; print('EXT_SUFFIX=', sysconfig.get_config_var('EXT_SUFFIX'))"
109104
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
112+
110113
- name: Install Dependencies
111114
run: |
112115
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
@@ -129,6 +132,7 @@ jobs:
129132
cd ..
130133
git clone https://github.com/PilotLightTech/pilotlight
131134
cd pilotlight-python
135+
python -m pip install pl-build
132136
133137
- name: Build Package
134138
run: |
@@ -163,10 +167,10 @@ jobs:
163167
- name: Checkout
164168
uses: actions/checkout@v4
165169

166-
- name: Set up Python 3.9
170+
- name: Set up Python 3.14
167171
uses: actions/setup-python@v5
168172
with:
169-
python-version: 3.9
173+
python-version: "3.14"
170174

171175
- name: Install Dependencies
172176
run: |
@@ -179,9 +183,9 @@ jobs:
179183
shell: cmd
180184
if: ${{contains(github.event.inputs.deploy, 'true') && github.ref == 'refs/heads/master'}}
181185
run: |
182-
python -m twine upload windowsbuild*/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }} --skip-existing
183-
python -m twine upload apple10sbuild*/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }} --skip-existing
184-
python -m twine upload linuxbuild*/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }} --skip-existing
186+
python -m twine upload windowsbuild*/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing
187+
rem python -m twine upload apple10sbuild*/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing
188+
python -m twine upload linuxbuild*/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing
185189
186190
- name: Test PyPi Deployment
187191
shell: cmd

pilotlight/pilotlight.so

-4.88 MB
Binary file not shown.

scripts/gen_build.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,14 @@
257257
pl.add_compiler_flags("-Zc:preprocessor", "-nologo", "-std:c11", "-W4", "-WX", "-wd4201",
258258
"-wd4100", "-wd4996", "-wd4505", "-wd4189", "-wd5105", "-wd4115",
259259
"-permissive-", "-Od", "-MDd", "-Zi")
260-
pl.set_post_target_build_step('@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n')
260+
pl.set_post_target_build_step(
261+
'@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n'
262+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python314_d.dll" "..\\out\\" >nul\n'
263+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python314.dll" "..\\out\\" >nul\n'
264+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python3.dll" "..\\out\\" >nul\n'
265+
'@copy "..\\dependencies\\cpython\\PCbuild\\amd64\\python3_d.dll" "..\\out\\" >nul\n'
266+
)
267+
261268

262269
with pl.platform("Linux"):
263270
with pl.compiler("gcc"):
@@ -297,6 +304,21 @@
297304
"-permissive-", "-Od", "-MD", "-Zi")
298305
pl.set_post_target_build_step('@copy "%VULKAN_SDK%\\bin\\spirv-cross-c-shared.dll" "..\\pilotlight\\" >nul\n')
299306

307+
with pl.platform("Linux"):
308+
with pl.compiler("gcc"):
309+
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")
312+
313+
pl.add_definitions("PL_VULKAN_BACKEND")
314+
pl.add_include_directories('$VULKAN_SDK/include', '/usr/include/vulkan')
315+
pl.set_output_binary_extension(".so")
316+
pl.add_compiler_flags("-fPIC")
317+
pl.add_compiler_flags("--debug -g")
318+
pl.add_linker_flags("-ldl -lm")
319+
pl.add_dynamic_link_libraries("shaderc_shared", "spirv-cross-c-shared", "vulkan")
320+
pl.add_static_link_libraries("glfw", "pl_platform_ext")
321+
pl.add_link_directories('$VULKAN_SDK/lib')
300322

301323
#-----------------------------------------------------------------------------
302324
# [SECTION] generate scripts

setup.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
import sys
66

7-
wip_version = "0.1.0"
7+
wip_version = "0.1.1"
88

99
def get_platform():
1010

@@ -41,13 +41,16 @@ def setup_package():
4141
# long_description_content_type='text/markdown', # Optional
4242
# url='https://github.com/PilotLightTech/pilotlight-python', # Optional
4343
license = 'MIT',
44-
python_requires='>=3.14',
44+
python_requires='>=3.12',
4545
classifiers=[
4646
'Development Status :: 3 - Alpha',
4747
'Intended Audience :: Education',
4848
'Intended Audience :: Developers',
4949
'Intended Audience :: Science/Research',
5050
'Operating System :: Microsoft :: Windows :: Windows 10',
51+
'Operating System :: POSIX',
52+
'Operating System :: Unix',
53+
'Programming Language :: Python :: 3.12',
5154
'Programming Language :: Python :: 3.14',
5255
'Programming Language :: Python :: Implementation :: CPython',
5356
'Programming Language :: Python :: 3 :: Only',
@@ -71,6 +74,17 @@ def setup_package():
7174
"pl_vfs_ext.py",
7275
"spirv-cross-c-shared.dll"
7376
]
77+
else:
78+
metadata['package_data']['pilotlight'] = [
79+
"__init__.py",
80+
"pilotlight.so",
81+
"pilotlight.pyi",
82+
"pl_core.py",
83+
"pl_draw_ext.py",
84+
"pl_starter_ext.py",
85+
"pl_ui_ext.py",
86+
"pl_vfs_ext.py"
87+
]
7488

7589
if "--force" in sys.argv:
7690
sys.argv.remove('--force')

src/build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ PL_RESULT=${BOLD}${GREEN}Successful.${NC}
269269
PL_DEFINES="-D_USE_MATH_DEFINES -DPy_PYTHON_H "
270270
PL_INCLUDE_DIRECTORIES="-I../src -I../../pilotlight/libs -I../../pilotlight/extensions -I../../pilotlight/dependencies/stb -I../../pilotlight/src "
271271
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L../../pilotlight/out -Wl,-rpath,../../pilotlight/out "
272-
PL_COMPILER_FLAGS=""
273-
PL_LINKER_FLAGS=""
272+
PL_COMPILER_FLAGS="-fPIC "
273+
PL_LINKER_FLAGS="-ldl -lm "
274274
PL_STATIC_LINK_LIBRARIES=""
275275
PL_DYNAMIC_LINK_LIBRARIES="-lpthread "
276276
# # run compiler only

src/build_win32.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ cl %PL_INCLUDE_DIRECTORIES% %PL_DEFINES% %PL_COMPILER_FLAGS% %PL_SOURCES% -Fe"..
221221
@echo ~~~~~~~~~~~~~~~~~~~~~~
222222

223223
@copy "%VULKAN_SDK%\bin\spirv-cross-c-shared.dll" "..\pilotlight\" >nul
224+
@copy "..\dependencies\cpython\PCbuild\amd64\python314_d.dll" "..\out\" >nul
225+
@copy "..\dependencies\cpython\PCbuild\amd64\python314.dll" "..\out\" >nul
226+
@copy "..\dependencies\cpython\PCbuild\amd64\python3.dll" "..\out\" >nul
227+
@copy "..\dependencies\cpython\PCbuild\amd64\python3_d.dll" "..\out\" >nul
224228

225229

226230
:Exit_pilotlight

0 commit comments

Comments
 (0)