Browse Source

deploy-ng: Create entry_points in makewheel for dist commands

This allows setuptools to automatically find build_p3d and
bdist_p3d_archive.

NOTE: Importing direct.showutil.dist.setup still works for installs that
are not using wheels.
Mitchell Stokes 9 years ago
parent
commit
b8ee352ebb
2 changed files with 4 additions and 1 deletions
  1. 3 0
      makepanda/makewheel.py
  2. 1 1
      samples/asteroids/setup.py

+ 3 - 0
makepanda/makewheel.py

@@ -577,6 +577,9 @@ def makewheel(version, output_dir, platform=default_platform):
             funcname = basename.replace('-', '_')
             funcname = basename.replace('-', '_')
             entry_points += '{0} = panda3d_tools:{1}\n'.format(basename, funcname)
             entry_points += '{0} = panda3d_tools:{1}\n'.format(basename, funcname)
             tools_init += '{0} = lambda: _exec_tool({1!r})\n'.format(funcname, file)
             tools_init += '{0} = lambda: _exec_tool({1!r})\n'.format(funcname, file)
+    entry_points += '[distutils.commands]\n'
+    entry_points += 'build_p3d = direct.showutil.dist:build_p3d\n'
+    entry_points += 'bdist_p3d_archive = direct.showutil.dist:bdist_p3d_archive\n'
 
 
     whl.write_file_data('panda3d_tools/__init__.py', PANDA3D_TOOLS_INIT.format(tools_init))
     whl.write_file_data('panda3d_tools/__init__.py', PANDA3D_TOOLS_INIT.format(tools_init))
 
 

+ 1 - 1
samples/asteroids/setup.py

@@ -1,4 +1,4 @@
-from direct.showutil.dist import *
+from setuptools import setup
 
 
 setup(
 setup(
     name="asteroids",
     name="asteroids",