Merge branch 'release/1.10.x'

This commit is contained in:
rdb 2020-09-16 10:59:59 +02:00
commit 54b93116e8
7 changed files with 32 additions and 37 deletions

View File

@ -24,7 +24,7 @@ Installing Panda3D
==================
The latest Panda3D SDK can be downloaded from
[this page](https://www.panda3d.org/download/sdk-1-10-6/).
[this page](https://www.panda3d.org/download/sdk-1-10-7/).
If you are familiar with installing Python packages, you can use
the following command:
@ -64,8 +64,8 @@ depending on whether you are on a 32-bit or 64-bit system, or you can
[click here](https://github.com/rdb/panda3d-thirdparty) for instructions on
building them from source.
- https://www.panda3d.org/download/panda3d-1.10.6/panda3d-1.10.6-tools-win64.zip
- https://www.panda3d.org/download/panda3d-1.10.6/panda3d-1.10.6-tools-win32.zip
- https://www.panda3d.org/download/panda3d-1.10.7/panda3d-1.10.7-tools-win64.zip
- https://www.panda3d.org/download/panda3d-1.10.7/panda3d-1.10.7-tools-win32.zip
After acquiring these dependencies, you can build Panda3D from the command
prompt using the following command. Change the `--msvc-version` option based
@ -136,7 +136,7 @@ macOS
-----
On macOS, you will need to download a set of precompiled thirdparty packages in order to
compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.6/panda3d-1.10.6-tools-mac.tar.gz).
compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.7/panda3d-1.10.7-tools-mac.tar.gz).
After placing the thirdparty directory inside the panda3d source directory,
you may build Panda3D using a command like the following:

View File

@ -1022,7 +1022,10 @@ class build_apps(setuptools.Command):
source_dir = os.path.dirname(source_path)
target_dir = os.path.dirname(target_path)
base = os.path.basename(target_path)
self.copy_dependencies(target_path, target_dir, search_path + [source_dir], base)
if source_dir not in search_path:
search_path = search_path + [source_dir]
self.copy_dependencies(target_path, target_dir, search_path, base)
def copy_dependencies(self, target_path, target_dir, search_path, referenced_by):
""" Copies the dependencies of target_path into target_dir. """
@ -1037,8 +1040,7 @@ class build_apps(setuptools.Command):
pe = pefile.PEFile()
pe.read(fp)
for lib in pe.imports:
if not lib.lower().startswith('api-ms-win-'):
deps.append(lib)
deps.append(lib)
elif magic == b'\x7FELF':
# Elf magic. Used on (among others) Linux and FreeBSD.

View File

@ -52,6 +52,7 @@ Deployment
* Fix libffi-7.dll not being included in official wheels
* PYTHONINSPECT mechanism is no longer enabled when building with optimizations
* A few unnecessary warning messages are squelched
* Windows builds now include previously missing CRT dlls
API
* Add pickle support to Datagram class

View File

@ -726,7 +726,7 @@ def MakeInstallerFreeBSD(version, python_versions=[], **kwargs):
oscmd("rm -f %s/tmp/python_dep" % outputdir)
if "PYTHONVERSION" in SDK:
pyver_nodot = SDK["PYTHONVERSION"][6:].replace('.', '')
pyver_nodot = SDK["PYTHONVERSION"][6:].rstrip('dmu').replace('.', '')
else:
pyver_nodot = "%d%d" % (sys.version_info[:2])

View File

@ -3360,7 +3360,7 @@ def GetCurrentPythonVersionInfo():
from distutils.sysconfig import get_python_lib
return {
"version": SDK["PYTHONVERSION"][6:],
"version": SDK["PYTHONVERSION"][6:].rstrip('dmu'),
"soabi": GetPythonABI(),
"ext_suffix": GetExtensionSuffix(),
"executable": sys.executable,

View File

@ -610,6 +610,26 @@ def makewheel(version, output_dir, platform=None):
whl.ignore_deps.update(MANYLINUX_LIBS)
# Add libpython for deployment.
if sys.platform in ('win32', 'cygwin'):
pylib_name = 'python{0}{1}.dll'.format(*sys.version_info)
pylib_path = os.path.join(get_config_var('BINDIR'), pylib_name)
elif sys.platform == 'darwin':
pylib_name = 'libpython{0}.{1}.dylib'.format(*sys.version_info)
pylib_path = os.path.join(get_config_var('LIBDIR'), pylib_name)
else:
pylib_name = get_config_var('LDLIBRARY')
pylib_arch = get_config_var('MULTIARCH')
libdir = get_config_var('LIBDIR')
if pylib_arch and os.path.exists(os.path.join(libdir, pylib_arch, pylib_name)):
pylib_path = os.path.join(libdir, pylib_arch, pylib_name)
else:
pylib_path = os.path.join(libdir, pylib_name)
# If Python was linked statically, we don't need to include this.
if not pylib_name.endswith('.a'):
whl.write_file('deploy_libs/' + pylib_name, pylib_path)
# Add the trees with Python modules.
whl.write_directory('direct', direct_dir)
@ -738,26 +758,6 @@ if __debug__:
whl.write_file(info_dir + '/README.md', readme_src)
whl.write_file_data(info_dir + '/top_level.txt', 'direct\npanda3d\npandac\npanda3d_tools\n')
# Add libpython for deployment
if sys.platform in ('win32', 'cygwin'):
pylib_name = 'python{0}{1}.dll'.format(*sys.version_info)
pylib_path = os.path.join(get_config_var('BINDIR'), pylib_name)
elif sys.platform == 'darwin':
pylib_name = 'libpython{0}.{1}.dylib'.format(*sys.version_info)
pylib_path = os.path.join(get_config_var('LIBDIR'), pylib_name)
else:
pylib_name = get_config_var('LDLIBRARY')
pylib_arch = get_config_var('MULTIARCH')
libdir = get_config_var('LIBDIR')
if pylib_arch and os.path.exists(os.path.join(libdir, pylib_arch, pylib_name)):
pylib_path = os.path.join(libdir, pylib_arch, pylib_name)
else:
pylib_path = os.path.join(libdir, pylib_name)
# If Python was linked statically, we don't need to include this.
if not pylib_name.endswith('.a'):
whl.write_file('deploy_libs/' + pylib_name, pylib_path)
whl.close()

View File

@ -146,14 +146,6 @@ def test_weighted_choice():
# Assert that we got 'item1'.
assert item == items[0]
# Test PythonUtil.weightedChoice() with an invalid sum.
# This time, we're using 2000 so that regardless of the random
# number, we will still reach the very last item.
item = PythonUtil.weightedChoice(choicelist, sum=100000)
# Assert that we got 'item8', since we would get the last item.
assert item == items[-1]
# Create a bogus random function.
rnd = lambda: 0.5