Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
34c04f4
Added cibuildwheel configuration
SomeParticles Aug 23, 2024
7ac2b58
working pyproject.toml
SomeParticles Aug 23, 2024
6bd1c69
restructured mtca4u
SomeParticles Aug 23, 2024
b11281d
working pyproject for mtca4u package
SomeParticles Aug 23, 2024
a660e07
updates
SomeParticles Aug 23, 2024
ab7d3a6
Added switch for SKBUILD findpython
SomeParticles Aug 23, 2024
df991d4
working cibuildwheel configuration
SomeParticles Aug 25, 2024
04d67fc
reorganized structure
SomeParticles Sep 2, 2024
dd85535
link to all dependencies
SomeParticles Sep 2, 2024
a6b3a35
Fixed tests
SomeParticles Sep 2, 2024
7748d92
Added tests to cibuildwheel
SomeParticles Sep 2, 2024
03b70f5
disabled tests
SomeParticles Sep 2, 2024
9b65ecd
removed --whole-archive
SomeParticles Sep 2, 2024
54a61e6
CMakeLists comment backend change
SomeParticles Sep 2, 2024
86bc1b3
fix: fixed and deleted plugins
bellaz89 Oct 17, 2025
c578a69
feat: added deviceaccess c++ dependencies to pre_build_manylinux.sh
bellaz89 Oct 17, 2025
690e362
fix: pyprojects aarch64 cibuildwheel image name
bellaz89 Oct 18, 2025
d837b79
merge:03.05.02
bellaz89 Oct 18, 2025
75f069c
feat: advanced version
bellaz89 Oct 18, 2025
5da0f39
fix: using the latest version of cppext allows using the latest versi…
bellaz89 Oct 19, 2025
b6e6775
merge: 04.00.01 branch
bellaz89 Oct 19, 2025
5e279b9
fix: removed old files
bellaz89 Oct 19, 2025
24e2357
fix: missing mtca4u.py
bellaz89 Oct 19, 2025
5f3225b
fix: checkout tests. Add autopep configuration
bellaz89 Oct 19, 2025
ec9c843
fix: move deviceaccess and mtca4u modules at root
bellaz89 Oct 19, 2025
9a51947
chore: add __pycache__ to .gitignore
bellaz89 Oct 19, 2025
3273bfa
chore: add note why tests are disabled in cibuildwheel
Oct 20, 2025
486d367
fix: minor cibuildwheel configuration error
Oct 20, 2025
0a6eef0
fix: sanitized wheel structure. To test
Oct 20, 2025
a1c8a12
fix: improved modules
Oct 20, 2025
eeaf597
chore: rename extension name
bellaz89 Oct 20, 2025
cadc8bc
fix: move deviceaccess.pyi to __init__.py when generatin the wheel
bellaz89 Oct 20, 2025
f967874
feat: added py.typed for pyright
bellaz89 Oct 20, 2025
5be6af2
chore: set more precise manylinux images in pyproject.toml
Oct 21, 2025
e7a2aca
chore: cleaned up pre_build_manylinux.sh installation of system depen…
Oct 21, 2025
e3ac58d
fix: add correct manylinux address
Nov 12, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ CMakeLists.txt.user
*.code-workspace
#used by PyCharm IDE
.idea/
wheelhouse/
__pycache__/
29 changes: 21 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,26 @@ endif()

# ==============================================================================#

# install Python modules to correct platform-dependent directory (if installing to system prefix)
if( "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" )
set( install_path ${Python_SITEARCH} )
if(SKBUILD)
install( FILES ${PROJECT_BINARY_DIR}/deviceaccess.pyi
DESTINATION "${PROJECT_SOURCE_DIR}/src/deviceaccess"
RENAME __init__.pyi )
install( FILES ${PROJECT_BINARY_DIR}/deviceaccess.pyi
DESTINATION "${PROJECT_SOURCE_DIR}/src/deviceaccess" )
install( FILES ${PROJECT_SOURCE_DIR}/mtca4u.py
DESTINATION "${PROJECT_SOURCE_DIR}/src/mtca4u"
RENAME __init__.py )
install( TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION "${PROJECT_SOURCE_DIR}/src/deviceaccess" )
else()
set( install_path "lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages" )
# install Python modules to correct platform-dependent directory (if installing to system prefix)
if( "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" )
set( install_path ${Python_SITEARCH} )
else()
set( install_path "lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages" )
endif()

install( FILES ${PROJECT_BINARY_DIR}/deviceaccess.pyi DESTINATION ${install_path} )
install( FILES ${PROJECT_SOURCE_DIR}/mtca4u.py DESTINATION ${install_path} )
install( TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${install_path} )
endif()

install( FILES ${PROJECT_BINARY_DIR}/deviceaccess.pyi DESTINATION ${install_path} )
install( FILES ${PROJECT_SOURCE_DIR}/mtca4u.py DESTINATION ${install_path} )
install( TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${install_path} )
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Bindings for ChimeraTK DeviceAcess Library
# Bindings for ChimeraTK DeviceAccess Library
Find API documentation [here](https://chimeratk.github.io/ChimeraTK-DeviceAccess-PythonBindings/head/html)
52 changes: 52 additions & 0 deletions pre_build_manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

# For manylinux_2_28

# Dependencies versions
export CPPEXT_VERSION="01.07.00"
export EXPRTK_VERSION="01.04.02"
export NLOHMANN_JSON_VERSION="v3.12.0"
export DEVICEACCESS_VERSION="03.24.01"

export PROJECT_PWD=`pwd`
export PROCS=`nproc`

# Creating local build directories
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}

# Helper function to build cmake-based projects
build_cmake () {
cd $1
mkdir builddir
cd builddir/
cmake -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF -DBUILD_TESTING=OFF -DBUILD_TESTS=OFF ..
make install -j${PROCS}
cd ${BUILD_DIR}
}

# Install required system packages
dnf install -y epel-release
dnf -y install gcc-c++ gcc-toolset-14-libatomic-devel libxml++-devel boost1.78-devel

g++ --version

# Install cppext
git clone --recursive --depth 1 --branch ${CPPEXT_VERSION} https://github.com/ChimeraTK/cppext.git
build_cmake cppext

# Install exprtk
git clone --recursive --depth 1 --branch ${EXPRTK_VERSION} https://github.com/ChimeraTK/exprtk-interface.git
build_cmake exprtk-interface

# Install nlohmann-json
git clone --recursive --depth 1 --branch ${NLOHMANN_JSON_VERSION} https://github.com/nlohmann/json.git
build_cmake json

# Install ChimeraTK-DeviceAccess
git clone --recursive --depth 1 --branch ${DEVICEACCESS_VERSION} https://github.com/ChimeraTK/DeviceAccess.git
build_cmake DeviceAccess

cd ${PROJECT_PWD}

80 changes: 79 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,80 @@
[build-system]
requires = [
"scikit-build-core",
"numpy",
"pybind11>=3.0",
"mypy>=1.0"
]

build-backend = "scikit_build_core.build"

[project]
name = "deviceaccess"
version = "4.0.1"
dependencies = [
"numpy",
"mypy>=1.0"
]
description = "Python bindings for the ChimeraTK's deviceaccess library"
long_description = "The package provides binding for the ChimeraTK's deviceaccess library"
requires-python = ">=3.8"
readme = "README.md"
license = {file = "LICENSE"}

classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering"
]

[project.urls]
Homepage = "https://github.com/ChimeraTK/DeviceAccess-PythonBindings"
Documentation = "https://chimeratk.github.io/ChimeraTK-DeviceAccess-PythonBindings/head/html/"
Repository = "https://github.com/ChimeraTK/DeviceAccess-PythonBindings"

[tool.scikit-build]
# Protect the configuration against future changes in scikit-build-core
minimum-version = "0.4"

# Setuptools-style build caching in a local directory
build-dir = "build/{wheel_tag}"
wheel.packages = ["src/mtca4u", "src/deviceaccess"]

[tool.cibuildwheel]
before-all = "bash pre_build_manylinux.sh"
skip = "cp314t-* *-win32 *_i686 *-musllinux_*"
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:2025.10.10-1"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:2025.10.10-1"

# Necessary to see build output from the actual compilation
build-verbosity = 1

## Run unittest to ensure that the package was correctly built
## tests disabled due to corruption on interpreter exit
## Note: tests are disabled at the moment since to make it work, the
## resource path of them should be made cwd -independent
# test-command = "python -m unittest discover -v {package}/tests"
test-skip = "*"

[tool.cibuildwheel.linux.environment]

# Add the build directory to the environment variables
BUILD_DIR="${HOME}/build"
PKG_CONFIG_PATH="${BUILD_DIR}/local/lib/pkgconfig/:/usr/lib/pkgconfig:${PKG_CONFIG_PATH}"
LD_LIBRARY_PATH="${BUILD_DIR}/local/lib/:${LD_LIBRARY_PATH}"
PATH="${BUILD_DIR}/local/bin/:${PATH}"

[tool.autopep8]
max_line_length = 120
max_line_length = 120

9 changes: 9 additions & 0 deletions src/deviceaccess/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from . import deviceaccess

try:
__all__ = tuple(deviceaccess.__all__)
except Exception:
__all__ = tuple(n for n in dir(deviceaccess) if not n.startswith("_"))

# Populate the namespace eagerly
globals().update({name: getattr(deviceaccess, name) for name in __all__})
Empty file added src/deviceaccess/py.typed
Empty file.