parent
aa58b4ccf2
commit
1f41edd0a0
|
|
@ -0,0 +1,16 @@
|
||||||
|
# This module should not import Panda3D modules globally as it contains hooks
|
||||||
|
# that may be invoked by setuptools even when Panda3D is not used. If the
|
||||||
|
# Panda3D installation is broken, it should not affect other applications.
|
||||||
|
|
||||||
|
__all__ = ('finalize_distribution_options', )
|
||||||
|
|
||||||
|
|
||||||
|
def finalize_distribution_options(dist):
|
||||||
|
"""Entry point for compatibility with setuptools>=61, see #1394."""
|
||||||
|
|
||||||
|
options = dist.get_option_dict('build_apps')
|
||||||
|
if options.get('gui_apps') or options.get('console_apps'):
|
||||||
|
# Make sure this is set to avoid auto-discovery taking place.
|
||||||
|
if getattr(dist.metadata, 'py_modules', None) is None and \
|
||||||
|
getattr(dist.metadata, 'packages', None) is None:
|
||||||
|
dist.py_modules = []
|
||||||
|
|
@ -25,6 +25,7 @@ import distutils.log
|
||||||
from . import FreezeTool
|
from . import FreezeTool
|
||||||
from . import pefile
|
from . import pefile
|
||||||
from .icon import Icon
|
from .icon import Icon
|
||||||
|
from ._dist_hooks import finalize_distribution_options
|
||||||
import panda3d.core as p3d
|
import panda3d.core as p3d
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1765,14 +1766,3 @@ class bdist_apps(setuptools.Command):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.announce('\tUnknown installer: {}'.format(installer), distutils.log.ERROR)
|
self.announce('\tUnknown installer: {}'.format(installer), distutils.log.ERROR)
|
||||||
|
|
||||||
|
|
||||||
def finalize_distribution_options(dist):
|
|
||||||
"""Entry point for compatibility with setuptools>=61, see #1394."""
|
|
||||||
|
|
||||||
options = dist.get_option_dict('build_apps')
|
|
||||||
if options.get('gui_apps') or options.get('console_apps'):
|
|
||||||
# Make sure this is set to avoid auto-discovery taking place.
|
|
||||||
if getattr(dist.metadata, 'py_modules', None) is None and \
|
|
||||||
getattr(dist.metadata, 'packages', None) is None:
|
|
||||||
dist.py_modules = []
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue