Skip to content
Open
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
16 changes: 16 additions & 0 deletions bindings/pyroot/pythonizations/python/ROOT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import types
from importlib.abc import Loader, MetaPathFinder
from importlib.machinery import ModuleSpec
from importlib.metadata import PackageNotFoundError, version

from . import _asan # noqa: F401 # imported for side effects for setup specific to AddressSanitizer environments
from ._facade import ROOTFacade
Expand Down Expand Up @@ -190,6 +191,21 @@ def find_spec(self, fullname: str, path, target=None) -> ModuleSpec:

# from . import JsMVA

# Print a warning for users of the ROOT wheel alpha distribution
try:
if "a" in version("ROOT"):
import warnings

warnings.warn(
"This distribution of ROOT is in alpha stage. Feedback is welcome and appreciated. "
"Feel free to reach out to the user forum for questions and general feedback at "
"https://github.com/root-project/root/issues. "
"Do not rely on this distribution for production purposes.",
stacklevel=2, # emit the warning in the caller
)
except PackageNotFoundError:
pass


def _cleanup():
# Delete TBrowser instances while the GUI event loop is still alive,
Expand Down
70 changes: 64 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[build-system]
requires = ["cmake", "setuptools<72", "wheel", "numpy"]
requires = ["scikit-build-core>=0.10"]
build-backend = "scikit_build_core.build"

[project]
name = "ROOT"
version = "0.1a12"
name = "root"
version = "0.1a14"
requires-python = ">=3.10"
maintainers = [
{name = "Vincenzo Eduardo Padulano", email = "vincenzo.eduardo.padulano@cern.ch"}
Expand All @@ -15,16 +16,73 @@ dependencies = [
"numpy",
]

# Demonstrate how to expose ROOT CLI tools the Python way. For now only include
# `root`, other tools can be added later using the same approach.
# Point backend to python packages and to explicitly use Ninja
[tool.scikit-build]
wheel.packages = [
"bindings/pyroot/pythonizations/python/ROOT",
"bindings/pyroot/cppyy/cppyy/python/cppyy",
]
cmake.args = [
"-GNinja",
]

[tool.scikit-build.cmake.define]
# CMake install directories
CMAKE_INSTALL_BINDIR = "ROOT/bin"
CMAKE_INSTALL_CMAKEDIR = "ROOT/cmake"
CMAKE_INSTALL_FONTDIR = "ROOT/fonts"
CMAKE_INSTALL_ICONDIR = "ROOT/icons"
CMAKE_INSTALL_INCLUDEDIR = "ROOT/include"
CMAKE_INSTALL_LIBDIR = "ROOT/lib"
CMAKE_INSTALL_MACRODIR = "ROOT/macros"
CMAKE_INSTALL_MANDIR = "ROOT/man"
CMAKE_INSTALL_PYTHONDIR = "."
CMAKE_INSTALL_SYSCONFDIR = "ROOT/etc"
CMAKE_INSTALL_TUTDIR = "ROOT/tutorials"

# Generic minimal build config
gminimal="ON"
asimage="ON"
opengl="OFF"
runtime_cxxmodules="ON"
fail-on-missing="ON"

# Explicitly list components that gminimal implicitly turns off as documentation
# tmva-pymva and tpython are disabled for manylinux compatibility
# see https://peps.python.org/pep-0513/#libpythonx-y-so-1
tmva-pymva="OFF"
tpython="OFF"
thisroot_scripts="OFF" # the thisroot.* scripts are broken if CMAKE_INSTALL_PYTHONDIR!=CMAKE_INSTALL_LIBDIR

# Builtins
builtin_nlohmannjson="ON"
builtin_tbb="ON"
builtin_xrootd="ON"
builtin_tiff="ON"
builtin_lz4="ON"
builtin_fftw3="ON"
builtin_gsl="ON"
builtin_lzma="ON"
builtin_zstd="ON"
builtin_xxhash="ON"
pyroot="ON"
dataframe="ON"
xrootd="ON"
ssl="ON"
imt="ON"
roofit="ON"
mathmore="ON"

# Expose the ROOT cli as an executable command via _rootcli wrapper
[project.scripts]
root = "ROOT._rootcli:main"

[tool.cibuildwheel]
# Increase pip debugging output
build-frontend = { name = "build" }
build-verbosity = 1
manylinux-x86_64-image = "manylinux_2_28"

# Install system libraries
[tool.cibuildwheel.linux]
before-all = "dnf install -y epel-release && /usr/bin/crb enable && dnf install -y openssl-devel libX11-devel libXpm-devel libXft-devel libXext-devel libuuid-devel libjpeg-devel giflib-devel libtiff-devel"

184 changes: 0 additions & 184 deletions setup.py

This file was deleted.

Loading