diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c61f196..95a487e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -41,7 +41,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest, macos-latest, macos-latest-large] steps: - uses: actions/checkout@v6 @@ -59,8 +59,6 @@ jobs: - name: build wheels run: python -m cibuildwheel - env: - CIBW_ENVIRONMENT_WINDOWS: SKBUILD_CMAKE_ARGS=-GNinja - uses: actions/upload-artifact@v5 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ed7bda..6a2288d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc") add_library(${PROJECT_NAME} STATIC ${SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) file(GLOB EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/examples/*.cc") @@ -21,7 +21,7 @@ if(pybind11_FOUND) pybind11_add_module(pyds ${CMAKE_CURRENT_SOURCE_DIR}/pyds/ds.cc) target_link_libraries(pyds PRIVATE ${PROJECT_NAME}) set_property(TARGET pyds PROPERTY INTERPROCEDURAL_OPTIMIZATION True) - set_target_properties(pyds PROPERTIES OUTPUT_NAME ds) + set_target_properties(pyds PROPERTIES OUTPUT_NAME _ds) install(TARGETS pyds DESTINATION pyds) else() message(STATUS "pybind11 not found, Python bindings will not be built.") diff --git a/pyds/ds.cc b/pyds/ds.cc index 84e1b3b..8926f96 100644 --- a/pyds/ds.cc +++ b/pyds/ds.cc @@ -90,7 +90,7 @@ auto rule_match(ds::rule_t* rule_1, ds::rule_t* rule_2, int length) -> std::uniq return std::unique_ptr(result); } -PYBIND11_MODULE(ds, m) { +PYBIND11_MODULE(_ds, m) { auto string_t = py::class_(m, "String"); auto item_t = py::class_(m, "Item"); auto variable_t = py::class_(m, "Variable"); diff --git a/pyds/ds.py b/pyds/ds.py new file mode 100644 index 0000000..e0bf52d --- /dev/null +++ b/pyds/ds.py @@ -0,0 +1,13 @@ +"""The interface module for the pybind11 extension module _ds.""" + +__all__ = [ + "String", + "Variable", + "Item", + "List", + "Term", + "Rule", + "Search", +] + +from ._ds import String, Variable, Item, List, Term, Rule, Search diff --git a/pyproject.toml b/pyproject.toml index 118e02d..a6b0c96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,3 +47,6 @@ select = ["E4", "E7", "E9", "F"] "tests/*" = ["E741", "E743", "F841"] [tool.ruff.format] + +[tool.cibuildwheel] +skip = "*-win32"