Skip to content

[PyROOT] Move CPython extensions in subdirectories #15310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion bindings/jupyroot/python/JupyROOT/helpers/handlers.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import queue

from JupyROOT import helpers
import libROOTPythonizations as _lib
import ROOT.libROOTPythonizations as _lib


class IOHandler(object):
25 changes: 19 additions & 6 deletions bindings/pyroot/pythonizations/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -172,6 +172,19 @@ set(libname ROOTPythonizations)

add_library(${libname} SHARED ${cpp_sources})

# To make sure that the library also ends up in the right subdirectory in the
# build directory tree.
if(MSVC)
set_target_properties(${libname}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/ROOT
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/ROOT
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/bin/ROOT
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/bin/ROOT)
else()
set_target_properties(${libname} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/ROOT)
endif()

# Insert the ROOTPythonizationsPySources in the dependency graph
add_dependencies(${libname} ROOTPythonizationsPySources)

@@ -215,16 +228,16 @@ target_link_libraries(PyROOT INTERFACE cppyy_backend cppyy ROOTPythonizations)

# Install library
install(TARGETS ${libname} EXPORT ${CMAKE_PROJECT_NAME}Exports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/ROOT COMPONENT libraries
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries)

# Install meta-target PyROOT3 (INTERFACE library)
# Install library
install(TARGETS PyROOT EXPORT ${CMAKE_PROJECT_NAME}Exports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/ROOT COMPONENT libraries
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries)

# Install Python sources and bytecode
install(DIRECTORY ${localruntimedir}/ROOT
1 change: 0 additions & 1 deletion bindings/pyroot/pythonizations/python/ROOT/__init__.py
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@

import cppyy
import sys, importlib
import libROOTPythonizations

# Build cache of commonly used python strings (the cache is python intern, so
# all strings are shared python-wide, not just in PyROOT).
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

from cppyy.gbl import gSystem, gInterpreter, gEnv

from libROOTPythonizations import InitApplication, InstallGUIEventInputHook
from ROOT.libROOTPythonizations import InitApplication, InstallGUIEventInputHook


class PyROOTApplication(object):
2 changes: 1 addition & 1 deletion bindings/pyroot/pythonizations/python/ROOT/_facade.py
Original file line number Diff line number Diff line change
@@ -175,7 +175,7 @@ def _register_converters_and_executors(self):
"Double32_t&": "double&",
}

from libROOTPythonizations import CPyCppyyRegisterConverterAlias, CPyCppyyRegisterExecutorAlias
from ROOT.libROOTPythonizations import CPyCppyyRegisterConverterAlias, CPyCppyyRegisterExecutorAlias

for name, target in converter_aliases.items():
CPyCppyyRegisterConverterAlias(name, target)
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

def pythonize_cppinstance():
import cppyy
from libROOTPythonizations import AddCPPInstancePickling
from ROOT.libROOTPythonizations import AddCPPInstancePickling

klass = cppyy._backend.CPPInstance

Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
# For the list of contributors see $ROOTSYS/README/CREDITS. #
################################################################################

from libROOTPythonizations import AddPrettyPrintingPyz
from ROOT.libROOTPythonizations import AddPrettyPrintingPyz

def _add_getitem_checked(klass):
# Parameters:
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
################################################################################

import cppyy
from libROOTPythonizations import AddTClassDynamicCastPyz
from ROOT.libROOTPythonizations import AddTClassDynamicCastPyz


def pythonize_tclass():
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
# For the list of contributors see $ROOTSYS/README/CREDITS. #
################################################################################

from libROOTPythonizations import AddTObjectEqNePyz
from ROOT.libROOTPythonizations import AddTObjectEqNePyz
import cppyy

# Searching
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@
\endpythondoc
"""

from libROOTPythonizations import GetBranchAttr, BranchPyz
from ROOT.libROOTPythonizations import GetBranchAttr, BranchPyz
from ._rvec import _array_interface_dtype_map, _get_cpp_type_from_numpy_type
from . import pythonization
from ROOT._pythonization._memory_utils import _should_give_up_ownership, _constructor_releasing_ownership, _SetDirectory_SetOwnership
Loading