Skip to content

Commit

Permalink
Remove submodule, and update pybind11 (#903)
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo KULESZA <[email protected]>
  • Loading branch information
HugoKulesza authored Dec 10, 2024
1 parent 3984fd3 commit 7dc98a7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

3 changes: 2 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ endif()

if(BUILD_PYTHON_BINDINGS)
#Build pythin bindings
add_subdirectory(lib/pybind11)
set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)
add_subdirectory(pypowsybl-cpp)
endif()
1 change: 0 additions & 1 deletion cpp/lib/pybind11
Submodule pybind11 deleted from 3e9dfa
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# actual dependencies
pandas==2.2.2; python_version >= "3.9"
pandas==2.2.3; python_version >= "3.9"
pandas==2.0.3; python_version <= "3.8"
prettytable==3.11.0 # last version supporting python 3.8
networkx
matplotlib==3.9.2; python_version >= "3.9"
matplotlib==3.7.5; python_version <= "3.8"
pybind11[global]==2.13.6

# optional dependencies
pandapower==2.14.11
Expand All @@ -14,7 +15,7 @@ sphinx==7.1.2
furo==2024.1.29

# CI dependencies
setuptools==73.0.1
setuptools==75.3.0
wheel==0.44.0
coverage==7.3.2
pytest>=8.3.3
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import zipfile
import glob

from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup
from packaging.version import parse

class PyPowsyblExtension(Extension):
class PyPowsyblExtension(Pybind11Extension):
def __init__(self):
Extension.__init__(self, 'pypowsybl._pypowsybl', sources=[])
Pybind11Extension.__init__(self, 'pypowsybl._pypowsybl',
["cpp/*"])


class PyPowsyblBuild(build_ext):
Expand All @@ -44,7 +45,7 @@ def build_extension(self, ext):
if not extdir.endswith(os.path.sep):
extdir += os.path.sep
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
'-DPYTHON_EXECUTABLE=' + sys.executable]
'-DPython_EXECUTABLE=' + sys.executable]

cfg = 'Debug' if self.debug else 'Release'
build_args = ['--config', cfg]
Expand Down

0 comments on commit 7dc98a7

Please sign in to comment.