Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion pyds/ds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<ds::rule_t>(result);
}

PYBIND11_MODULE(ds, m) {
PYBIND11_MODULE(_ds, m) {
auto string_t = py::class_<ds::string_t>(m, "String");
auto item_t = py::class_<ds::item_t>(m, "Item");
auto variable_t = py::class_<ds::variable_t>(m, "Variable");
Expand Down
13 changes: 13 additions & 0 deletions pyds/ds.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ select = ["E4", "E7", "E9", "F"]
"tests/*" = ["E741", "E743", "F841"]

[tool.ruff.format]

[tool.cibuildwheel]
skip = "*-win32"