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
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"GitHub.copilot",
"ms-vscode.cmake-tools",
"ms-python.python",
"ms-azuretools.vscode-containers"
"ms-azuretools.vscode-containers",
"tamasfe.even-better-toml"
],
"settings": {
"clangd.arguments": [
Expand Down
34 changes: 29 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
name: Publish

on:
release:
types: [released]
workflow_dispatch:

jobs:
verify_version:
name: Verify tag matches pyproject version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check tag and project version alignment
env:
TAG_REF: ${{ github.ref_name }}
run: |
echo "Git tag ref: $TAG_REF"
FILE_VERSION=$(grep '^version =' pyproject.toml | head -1 | cut -d '"' -f2)
echo "pyproject.toml version: $FILE_VERSION"
if [ "$FILE_VERSION" != "$TAG_REF" ]; then
echo "Error: tag ($TAG_REF) does not match pyproject version ($FILE_VERSION)" >&2
exit 1
fi
echo "Success: tag matches project version ($FILE_VERSION)"

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
needs: verify_version
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ strategy.job-index }}
cancel-in-progress: true
Expand All @@ -20,7 +40,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.13"

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand All @@ -36,13 +56,14 @@ jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: verify_version

steps:
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.13"

- name: Build sdist
run: pipx run build --sdist
Expand All @@ -56,7 +77,9 @@ jobs:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/project/reelay/
permissions:
id-token: write

Expand All @@ -70,4 +93,5 @@ jobs:
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
repository-url: https://test.pypi.org/legacy/
3 changes: 3 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:

steps:
- uses: actions/checkout@v5

- uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand Down
50 changes: 24 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
[project]
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development :: Testing',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Programming Language :: Python :: 3',
]
keywords = ["reactive", "automata", "monitoring", "testing", "runtime"]
name = "reelay"
version = "25.0.0rc2"
description = "Reelay: A runtime verification library for real-time systems"
readme = "README.md"
requires-python = ">=3.8"
license = { "file" = "LICENSE" }
authors = [{ "name" = "Dogan Ulus", "email" = "doganulus@gmail.com" }]
urls = { "Documentation" = "https://doganulus.github.io/reelay" }
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Testing",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Programming Language :: Python :: 3",
]
keywords = ["reactive", "automata", "monitoring", "testing", "runtime"]
authors = [{ name = "Dogan Ulus", email = "doganulus@gmail.com" }]
urls = { Documentation = "https://doganulus.github.io/reelay" }
dependencies = []
dynamic = ["version", "description"]

[project.scripts]
add = "pybind11_project.add:main"

[project.optional-dependencies]
devel = [
"pytest"
]
devel = ["pytest"]
docs = [
"mkdocs",
"mkdocs-material",
"mkdocs-material-extensions",
"mkdocs-minify-plugin",
"mkdocs-redirects",
"mkdocs-git-revision-date-localized-plugin"
"mkdocs-git-revision-date-localized-plugin",
]

[build-system]
requires = ["py-build-cmake~=0.1.8", "pybind11"]
requires = ["setuptools>=61", "py-build-cmake>=0.5.0", "pybind11"]
build-backend = "py_build_cmake.build"

[tool.py-build-cmake.module]
Expand Down Expand Up @@ -71,11 +70,10 @@ env = {}
"REELAY_BUILD_APPS:BOOL" = "OFF"
"REELAY_BUILD_PYTHON_BINDINGS:BOOL" = "ON"

[tool.py-build-cmake.linux.cmake] # Linux-specific options
[tool.py-build-cmake.linux.cmake]
generator = "Ninja"
config = ["Release"]

options = { "CMAKE_DEBUG_POSTFIX" = "_d" }
options = { CMAKE_DEBUG_POSTFIX = "_d" }

[tool.pytest.ini_options]
minversion = "7.0"
Expand All @@ -85,9 +83,9 @@ cache_dir = "/tmp/reelay/.pytest_cache"

[tool.cibuildwheel]
container-engine = "podman"
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
skip = "cp314t-*"
manylinux-x86_64-image = "manylinux2014"
manylinux-aarch64-image = "manylinux2014"
skip = ["cp314t-*", "*-musllinux_*"]
test-command = "pytest"
test-requires = ["pytest"]
test-sources = ["python/tests"]
1 change: 0 additions & 1 deletion python/reelay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"""
Python bindings for Reelay C++ library
"""
__version__ = '25.0.0'

from .dense_timed_monitor import dense_timed_monitor
from .discrete_timed_monitor import discrete_timed_monitor
40 changes: 13 additions & 27 deletions src/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,31 @@
set(PY_VERSION_SUFFIX "")
set(PY_FULL_VERSION ${PROJECT_VERSION}${PY_VERSION_SUFFIX})
message(STATUS "Reelay version: ${PROJECT_VERSION}")
message(STATUS "Python version: ${PY_BUILD_CMAKE_PACKAGE_VERSION}")

message(STATUS "Python version: ${PY_FULL_VERSION}")

# Make sure that the Python and CMake versions match
# Make sure that the Python and CMake versions match)
if(DEFINED PY_BUILD_CMAKE_PACKAGE_VERSION)
if(NOT "${PY_BUILD_CMAKE_PACKAGE_VERSION}" MATCHES "^${PY_FULL_VERSION}$")
if(NOT "${PY_BUILD_CMAKE_PACKAGE_VERSION}" MATCHES
"^${PROJECT_VERSION}((a|b|rc)[0-9]+)?(\\.post[0-9]+)?(\\.dev[0-9]+)?$")
message(FATAL_ERROR "Version number does not match "
"(${PY_BUILD_CMAKE_PACKAGE_VERSION} - ${PY_FULL_VERSION}).")
"(${PROJECT_VERSION} - ${PY_BUILD_CMAKE_PACKAGE_VERSION}).")
endif()
endif()

# include(cmake/QueryPythonForPybind11.cmake)
# find_pybind11_python_first()

# Find the Python development files
find_package(Python3 REQUIRED COMPONENTS Development.Module)

# pybind11 is header-only, so finding a native version is fine
# find_package(
# pybind11
# ${ARGN}
# REQUIRED
# CONFIG
# CMAKE_FIND_ROOT_PATH_BOTH)

include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v3.0.1
)
FetchContent_MakeAvailable(pybind11)
fetchcontent_declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v3.0.1)
fetchcontent_makeavailable(pybind11)

# Compile the example Python module
pybind11_add_module(_pybind11_module MODULE "main.cpp")
target_link_libraries(_pybind11_module PRIVATE pybind11::pybind11 reelay::reelay)
target_compile_definitions(
_pybind11_module PRIVATE MODULE_NAME=$<TARGET_FILE_BASE_NAME:_pybind11_module>
VERSION_INFO="${PY_FULL_VERSION}")
VERSION_INFO="${PY_BUILD_CMAKE_PACKAGE_VERSION}")

# Hide all symbols by default (including external libraries on Linux)
set_target_properties(
Expand All @@ -59,5 +46,4 @@ install(
TARGETS _pybind11_module
EXCLUDE_FROM_ALL
COMPONENT python_modules
DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME}
)
DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME})
Loading