Sfoglia il codice sorgente

Merge branch 'release/1.10.x'

rdb 2 anni fa
parent
commit
277460061e
4 ha cambiato i file con 21 aggiunte e 3 eliminazioni
  1. 3 2
      direct/src/showbase/Loader.py
  2. 16 1
      makepanda/test_wheel.py
  3. 1 0
      setup.cfg
  4. 1 0
      tests/dist/test_FreezeTool.py

+ 3 - 2
direct/src/showbase/Loader.py

@@ -25,6 +25,7 @@ from panda3d.core import Loader as PandaLoader
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.showbase.DirectObject import DirectObject
 import warnings
+import sys
 
 # You can specify a phaseChecker callback to check
 # a modelPath to see if it is being loaded in the correct
@@ -153,10 +154,10 @@ class Loader(DirectObject):
 
         from importlib.metadata import entry_points
         eps = entry_points()
-        if isinstance(eps, dict): # Python 3.8 and 3.9
+        if sys.version_info < (3, 10):
             loaders = eps.get('panda3d.loaders', ())
         else:
-            loaders = entry_points().select(group='panda3d.loaders')
+            loaders = eps.select(group='panda3d.loaders')
 
         if loaders:
             registry = LoaderFileTypeRegistry.getGlobalPtr()

+ 16 - 1
makepanda/test_wheel.py

@@ -59,7 +59,22 @@ def test_wheel(wheel, verbose=False):
     if verbose:
         test_cmd.append("--verbose")
 
-    exit_code = subprocess.call(test_cmd)
+    # Put the location of the python DLL on the path, for deploy-stub test
+    # This is needed because venv does not install a copy of the python DLL
+    env = None
+    if sys.platform == "win32":
+        deploy_libs = os.path.join(envdir, "Lib", "site-packages", "deploy_libs")
+        if os.path.isdir(deploy_libs):
+            # We have to do this dance because os.environ is case insensitive
+            env = dict(os.environ)
+            for key, value in env.items():
+                if key.upper() == "PATH":
+                    env[key] = deploy_libs + ";" + value
+                    break
+            else:
+                env["PATH"] = deploy_libs
+
+    exit_code = subprocess.call(test_cmd, env=env)
     shutil.rmtree(envdir)
 
     if exit_code != 0:

+ 1 - 0
setup.cfg

@@ -18,6 +18,7 @@ classifiers =
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
     Programming Language :: Python :: 3.11
+    Programming Language :: Python :: 3.12
     Programming Language :: Python :: Implementation :: CPython
     Topic :: Games/Entertainment
     Topic :: Multimedia

+ 1 - 0
tests/dist/test_FreezeTool.py

@@ -89,6 +89,7 @@ def test_Freezer_generateRuntimeFromStub(tmp_path, use_console):
     target = str(tmp_path / ('stubtest' + suffix))
 
     freezer = Freezer()
+    freezer.addModule('site', filename='site.py', text='import sys\nsys.frozen=True')
     freezer.addModule('module2', filename='module2.py', text='print("Module imported")')
     freezer.addModule('__main__', filename='main.py', text='import module2\nprint("Hello world")')
     assert '__main__' in freezer.modules