Skip to content

Commit 926addd

Browse files
committed
[PyROOT] Move CPython extensions into subdirectories
Closes #14917.
1 parent 7a44727 commit 926addd

File tree

12 files changed

+26
-21
lines changed

12 files changed

+26
-21
lines changed

bindings/jupyroot/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ set(libname JupyROOT)
3434

3535
# libJupyROOT uses ROOT headers from source dirs and depends on Core
3636
add_library(${libname} SHARED src/IOHandler.cxx)
37+
38+
set_target_properties(${libname} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/JupyROOT)
39+
3740
# Set the suffix to '.so' and the prefix to 'lib'
3841
set_target_properties(${libname} PROPERTIES ${ROOT_LIBRARY_PROPERTIES})
3942
if(MSVC)
@@ -56,9 +59,9 @@ endforeach()
5659

5760
# Install library
5861
install(TARGETS ${libname} EXPORT ${CMAKE_PROJECT_NAME}Exports
59-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
60-
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries
61-
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries)
62+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/JupyROOT COMPONENT libraries
63+
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/JupyROOT COMPONENT libraries
64+
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/JupyROOT COMPONENT libraries)
6265

6366
# Install Python sources and bytecode
6467
install(DIRECTORY ${localruntimedir}/JupyROOT

bindings/jupyroot/python/JupyROOT/helpers/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import queue
2020

2121
from JupyROOT import helpers
22-
import libJupyROOT as _lib
22+
import JupyROOT.libJupyROOT as _lib
2323

2424

2525
class IOHandler(object):

bindings/pyroot/pythonizations/CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ set(libname ROOTPythonizations)
144144

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

147+
set_target_properties(${libname} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/ROOT)
148+
147149
# Insert the ROOTPythonizationsPySources in the dependency graph
148150
add_dependencies(${libname} ROOTPythonizationsPySources)
149151

@@ -187,16 +189,16 @@ target_link_libraries(PyROOT INTERFACE cppyy_backend cppyy ROOTPythonizations)
187189

188190
# Install library
189191
install(TARGETS ${libname} EXPORT ${CMAKE_PROJECT_NAME}Exports
190-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
191-
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries
192-
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries)
192+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/ROOT COMPONENT libraries
193+
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries
194+
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries)
193195

194196
# Install meta-target PyROOT3 (INTERFACE library)
195197
# Install library
196198
install(TARGETS PyROOT EXPORT ${CMAKE_PROJECT_NAME}Exports
197-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
198-
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries
199-
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries)
199+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/ROOT COMPONENT libraries
200+
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries
201+
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR}/ROOT COMPONENT libraries)
200202

201203
# Install Python sources and bytecode
202204
install(DIRECTORY ${localruntimedir}/ROOT

bindings/pyroot/pythonizations/python/ROOT/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import cppyy
2626
import sys, importlib
27-
import libROOTPythonizations
27+
import ROOT.libROOTPythonizations
2828

2929
# Build cache of commonly used python strings (the cache is python intern, so
3030
# all strings are shared python-wide, not just in PyROOT).
@@ -184,8 +184,8 @@ def cleanup():
184184
facade.__dict__["app"].keep_polling = False
185185
facade.__dict__["app"].process_root_events.join()
186186

187-
if "libROOTPythonizations" in sys.modules:
188-
backend = sys.modules["libROOTPythonizations"]
187+
if "ROOT.libROOTPythonizations" in sys.modules:
188+
backend = sys.modules["ROOT.libROOTPythonizations"]
189189

190190
# Make sure all the objects regulated by PyROOT are deleted and their
191191
# Python proxies are properly nonified.

bindings/pyroot/pythonizations/python/ROOT/_application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from cppyy.gbl import gSystem, gInterpreter, gEnv
1515

16-
from libROOTPythonizations import InitApplication, InstallGUIEventInputHook
16+
from ROOT.libROOTPythonizations import InitApplication, InstallGUIEventInputHook
1717

1818

1919
class PyROOTApplication(object):

bindings/pyroot/pythonizations/python/ROOT/_facade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import libcppyy as cppyy_backend
88
from cppyy import gbl as gbl_namespace
99
from cppyy import cppdef, include
10-
from libROOTPythonizations import gROOT
10+
from ROOT.libROOTPythonizations import gROOT
1111
from cppyy.gbl import gSystem
1212
import cppyy.ll
1313

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_cppinstance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
################################################################################
1010

1111
import libcppyy
12-
from libROOTPythonizations import AddCPPInstancePickling
12+
from ROOT.libROOTPythonizations import AddCPPInstancePickling
1313

1414
def pythonize_cppinstance():
1515
klass = libcppyy.CPPInstance

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# For the list of contributors see $ROOTSYS/README/CREDITS. #
99
################################################################################
1010

11-
from libROOTPythonizations import AddPrettyPrintingPyz
11+
from ROOT.libROOTPythonizations import AddPrettyPrintingPyz
1212

1313
def _add_getitem_checked(klass):
1414
# Parameters:

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_tclass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
################################################################################
1010

1111
import cppyy
12-
from libROOTPythonizations import AddTClassDynamicCastPyz
12+
from ROOT.libROOTPythonizations import AddTClassDynamicCastPyz
1313

1414

1515
def pythonize_tclass():

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_tmva/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from .. import pythonization
1818

19-
from libROOTPythonizations import gROOT
19+
from ROOT.libROOTPythonizations import gROOT
2020

2121
from ._factory import Factory
2222
from ._dataloader import DataLoader

0 commit comments

Comments
 (0)