feat(python): Repaired python bindings
Python bindings have now been brought back up to feature pairity with C++. Further, stubs have been added for all python features so that code completion will work
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# --- Python Extension Setup ---
|
||||
py_installation = import('python').find_installation('python3')
|
||||
py_installation = import('python').find_installation('python3', pure: false)
|
||||
|
||||
gridfire_py_deps = [
|
||||
pybind11_dep,
|
||||
@@ -10,11 +10,10 @@ gridfire_py_deps = [
|
||||
]
|
||||
|
||||
py_mod = py_installation.extension_module(
|
||||
'gridfire', # Name of the generated .so/.pyd file (without extension)
|
||||
'_gridfire', # Name of the generated .so/.pyd file (without extension)
|
||||
sources: [
|
||||
meson.project_source_root() + '/src/python/bindings.cpp',
|
||||
meson.project_source_root() + '/src/python/types/bindings.cpp',
|
||||
meson.project_source_root() + '/src/python/expectations/bindings.cpp',
|
||||
meson.project_source_root() + '/src/python/partition/bindings.cpp',
|
||||
meson.project_source_root() + '/src/python/partition/trampoline/py_partition.cpp',
|
||||
meson.project_source_root() + '/src/python/reaction/bindings.cpp',
|
||||
@@ -27,9 +26,52 @@ py_mod = py_installation.extension_module(
|
||||
meson.project_source_root() + '/src/python/engine/trampoline/py_engine.cpp',
|
||||
meson.project_source_root() + '/src/python/solver/bindings.cpp',
|
||||
meson.project_source_root() + '/src/python/solver/trampoline/py_solver.cpp',
|
||||
meson.project_source_root() + '/src/python/policy/bindings.cpp',
|
||||
meson.project_source_root() + '/src/python/policy/trampoline/py_policy.cpp',
|
||||
meson.project_source_root() + '/src/python/utils/bindings.cpp',
|
||||
],
|
||||
dependencies : gridfire_py_deps,
|
||||
cpp_args : ['-UNDEBUG'], # Example: Ensure assertions are enabled if needed
|
||||
install : true,
|
||||
)
|
||||
subdir: 'gridfire',
|
||||
)
|
||||
|
||||
|
||||
py_installation.install_sources(
|
||||
files(
|
||||
meson.project_source_root() + '/src/python/gridfire/__init__.py',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/__init__.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/exceptions.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/partition.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/reaction.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/screening.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/io.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/solver.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/policy.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/type.pyi'
|
||||
),
|
||||
subdir: 'gridfire',
|
||||
)
|
||||
|
||||
py_installation.install_sources(
|
||||
files(
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/__init__.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/engine/diagnostics.pyi',
|
||||
),
|
||||
subdir: 'gridfire/engine',
|
||||
)
|
||||
|
||||
py_installation.install_sources(
|
||||
files(
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/__init__.pyi',
|
||||
),
|
||||
subdir: 'gridfire/utils',
|
||||
)
|
||||
|
||||
py_installation.install_sources(
|
||||
files(
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/__init__.pyi',
|
||||
meson.project_source_root() + '/stubs/gridfire/_gridfire/utils/hashing/reaction.pyi',
|
||||
),
|
||||
subdir: 'gridfire/utils/hashing',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user