1111-- cppyy_backend/
1212-- libcppyy.so
1313-- libcppyy_backend.so
14- -- libROOTPythonizations.so
1514-- ROOT/
15+ -- -- libROOTPythonizations.so
1616```
1717
1818A custom extension module is injected in the setuptools setup to properly
@@ -42,17 +42,18 @@ def run(self):
4242 _build .run (self )
4343
4444 # Configure ROOT build
45- base_opts = shlex .split ("cmake -GNinja" )
45+ base_opts = shlex .split ("cmake -GNinja -Dccache=ON " )
4646 mode_opts = shlex .split (
4747 "-Dbuiltin_nlohmannjson=ON -Dbuiltin_tbb=ON -Dbuiltin_xrootd=ON " # builtins
4848 "-Dbuiltin_lz4=ON -Dbuiltin_lzma=ON -Dbuiltin_zstd=ON -Dbuiltin_xxhash=ON" # builtins
4949 "-Druntime_cxxmodules=ON -Drpath=ON -Dfail-on-missing=ON " # Generic build configuration
5050 "-Dgminimal=ON -Dasimage=ON -Dopengl=OFF " # Graphics
51- "-Dpyroot=ON -Ddataframe=ON -Dxrootd=ON -Dimt=ON "
52- "-Droofit=ON" )
53- dirs_opts = shlex . split (
54- f"-DCMAKE_INSTALL_PREFIX={ INSTALL_DIR } -B { BUILD_DIR } -S { SOURCE_DIR } " )
51+ "-Dpyroot=ON -Ddataframe=ON -Dxrootd=ON -Dssl=ON - Dimt=ON "
52+ "-Droofit=ON"
53+ )
54+ dirs_opts = shlex . split ( f"-DCMAKE_INSTALL_PREFIX={ INSTALL_DIR } -B { BUILD_DIR } -S { SOURCE_DIR } " )
5555 configure_command = base_opts + mode_opts + dirs_opts
56+ print (f"\n \n { ' ' .join (configure_command )} \n \n " )
5657 subprocess .run (configure_command , check = True )
5758
5859 # Run build with CMake
@@ -62,7 +63,7 @@ def run(self):
6263
6364class ROOTInstall (_install ):
6465 def _get_install_path (self ):
65- if hasattr (self , ' bdist_dir' ) and self .bdist_dir :
66+ if hasattr (self , " bdist_dir" ) and self .bdist_dir :
6667 install_path = self .bdist_dir
6768 else :
6869 install_path = self .install_lib
@@ -83,16 +84,13 @@ def run(self):
8384 self .copy_tree (INSTALL_DIR , os .path .join (install_path , "ROOT" ))
8485
8586 # Copy cppyy packages separately
86- self .copy_tree (os .path .join (lib_dir , "cppyy" ),
87- os .path .join (install_path , "cppyy" ))
88- self .copy_tree (os .path .join (lib_dir , "cppyy_backend" ),
89- os .path .join (install_path , "cppyy_backend" ))
87+ self .copy_tree (os .path .join (lib_dir , "cppyy" ), os .path .join (install_path , "cppyy" ))
88+ self .copy_tree (os .path .join (lib_dir , "cppyy_backend" ), os .path .join (install_path , "cppyy_backend" ))
9089
9190 # Finally copy CPython extension libraries
92- extlibs = ["libcppyy.so" , "libcppyy_backend.so" ,
93- "libROOTPythonizations.so" ]
94- for ext in extlibs :
95- self .copy_file (os .path .join (lib_dir , ext ), install_path )
91+ self .copy_file (os .path .join (lib_dir , "libcppyy.so" ), install_path )
92+ self .copy_file (os .path .join (lib_dir , "libcppyy_backend.so" ), install_path )
93+ self .copy_file (os .path .join (lib_dir , "ROOT" , "libROOTPythonizations.so" ), os .path .join (install_path , "ROOT" ))
9694
9795 def get_outputs (self ):
9896 outputs = _install .get_outputs (self )
@@ -103,31 +101,28 @@ class DummyExtension(Extension):
103101 """
104102 Dummy CPython extension for setuptools setup.
105103
106- In order to generate the wheel with CPython extension metadata (i.e.
104+ In order to generate the wheel with CPython extension metadata (i.e.
107105 producing one wheel per supported Python version), setuptools requires that
108106 at least one CPython extension is declared in the `ext_modules` kwarg passed
109107 to the `setup` function. Usually, declaring a CPython extension triggers
110108 compilation of the corresponding sources, but in this case we already do
111109 that in the CMake build step. This class defines a dummy extension that
112110 can be declared to setuptools while avoiding any further compilation step.
113111 """
112+
114113 def __init__ (_ ):
115114 super ().__init__ (name = "Dummy" , sources = [])
116115
117116
118- pkgs = (
119- find_packages ('bindings/pyroot/pythonizations/python' ) +
120- find_packages ('bindings/pyroot/cppyy/cppyy/python' , include = ['cppyy' ])
117+ pkgs = find_packages ("bindings/pyroot/pythonizations/python" ) + find_packages (
118+ "bindings/pyroot/cppyy/cppyy/python" , include = ["cppyy" ]
121119)
122120
123121s = setup (
124122 long_description = LONG_DESCRIPTION ,
125- package_dir = {'' : 'bindings/pyroot/pythonizations/python' ,
126- 'cppyy' : 'bindings/pyroot/cppyy/cppyy/python' },
123+ package_dir = {"" : "bindings/pyroot/pythonizations/python" , "cppyy" : "bindings/pyroot/cppyy/cppyy/python" },
127124 packages = pkgs ,
128125 # Crucial to signal this is not a pure Python package
129126 ext_modules = [DummyExtension ()],
130- cmdclass = {
131- 'build' : ROOTBuild ,
132- 'install' : ROOTInstall },
127+ cmdclass = {"build" : ROOTBuild , "install" : ROOTInstall },
133128)
0 commit comments