@@ -604,6 +604,26 @@ def makewheel(version, output_dir, platform=None):
604
604
605
605
whl .ignore_deps .update (MANYLINUX_LIBS )
606
606
607
+ # Add libpython for deployment.
608
+ if sys .platform in ('win32' , 'cygwin' ):
609
+ pylib_name = 'python{0}{1}.dll' .format (* sys .version_info )
610
+ pylib_path = os .path .join (get_config_var ('BINDIR' ), pylib_name )
611
+ elif sys .platform == 'darwin' :
612
+ pylib_name = 'libpython{0}.{1}.dylib' .format (* sys .version_info )
613
+ pylib_path = os .path .join (get_config_var ('LIBDIR' ), pylib_name )
614
+ else :
615
+ pylib_name = get_config_var ('LDLIBRARY' )
616
+ pylib_arch = get_config_var ('MULTIARCH' )
617
+ libdir = get_config_var ('LIBDIR' )
618
+ if pylib_arch and os .path .exists (os .path .join (libdir , pylib_arch , pylib_name )):
619
+ pylib_path = os .path .join (libdir , pylib_arch , pylib_name )
620
+ else :
621
+ pylib_path = os .path .join (libdir , pylib_name )
622
+
623
+ # If Python was linked statically, we don't need to include this.
624
+ if not pylib_name .endswith ('.a' ):
625
+ whl .write_file ('deploy_libs/' + pylib_name , pylib_path )
626
+
607
627
# Add the trees with Python modules.
608
628
whl .write_directory ('direct' , direct_dir )
609
629
@@ -723,26 +743,6 @@ def makewheel(version, output_dir, platform=None):
723
743
whl .write_file (info_dir + '/README.md' , readme_src )
724
744
whl .write_file_data (info_dir + '/top_level.txt' , 'direct\n panda3d\n pandac\n panda3d_tools\n ' )
725
745
726
- # Add libpython for deployment
727
- if sys .platform in ('win32' , 'cygwin' ):
728
- pylib_name = 'python{0}{1}.dll' .format (* sys .version_info )
729
- pylib_path = os .path .join (get_config_var ('BINDIR' ), pylib_name )
730
- elif sys .platform == 'darwin' :
731
- pylib_name = 'libpython{0}.{1}.dylib' .format (* sys .version_info )
732
- pylib_path = os .path .join (get_config_var ('LIBDIR' ), pylib_name )
733
- else :
734
- pylib_name = get_config_var ('LDLIBRARY' )
735
- pylib_arch = get_config_var ('MULTIARCH' )
736
- libdir = get_config_var ('LIBDIR' )
737
- if pylib_arch and os .path .exists (os .path .join (libdir , pylib_arch , pylib_name )):
738
- pylib_path = os .path .join (libdir , pylib_arch , pylib_name )
739
- else :
740
- pylib_path = os .path .join (libdir , pylib_name )
741
-
742
- # If Python was linked statically, we don't need to include this.
743
- if not pylib_name .endswith ('.a' ):
744
- whl .write_file ('deploy_libs/' + pylib_name , pylib_path )
745
-
746
746
whl .close ()
747
747
748
748
0 commit comments