mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
dist: Workaround to disable autodiscovery in setuptools>=61.0.0
See #1394 - creates a new finalize_distribution_options entry point that makes sure that either `py_modules` or `packages` is present, otherwise setuptools will activate its new auto-discovery system, even for custom commands that don't need setuptools' discovery system. However, this is not a great solution, because it applies when running all setuptools commands, not just build_apps.
This commit is contained in:
parent
d893b21f2b
commit
03d411c937
11
direct/src/dist/commands.py
vendored
11
direct/src/dist/commands.py
vendored
@ -1685,3 +1685,14 @@ class bdist_apps(setuptools.Command):
|
||||
|
||||
else:
|
||||
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 = []
|
||||
|
@ -3259,6 +3259,9 @@ Author-email: etc-panda3d@lists.andrew.cmu.edu
|
||||
ENTRY_POINTS = """[distutils.commands]
|
||||
build_apps = direct.dist.commands:build_apps
|
||||
bdist_apps = direct.dist.commands:bdist_apps
|
||||
|
||||
[setuptools.finalize_distribution_options]
|
||||
build_apps = direct.dist.commands:finalize_distribution_options
|
||||
"""
|
||||
|
||||
if not PkgSkip("DIRECT"):
|
||||
|
@ -765,6 +765,8 @@ __version__ = '{0}'
|
||||
entry_points += '[distutils.commands]\n'
|
||||
entry_points += 'build_apps = direct.dist.commands:build_apps\n'
|
||||
entry_points += 'bdist_apps = direct.dist.commands:bdist_apps\n'
|
||||
entry_points += '[setuptools.finalize_distribution_options]\n'
|
||||
entry_points += 'build_apps = direct.dist.commands:finalize_distribution_options\n'
|
||||
|
||||
whl.write_file_data('panda3d_tools/__init__.py', PANDA3D_TOOLS_INIT.format(tools_init))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user