Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[packaging] Adapt to Pyinstaller 6.x.x bundles #1041

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions PyMca5/PyMcaCore/RedisTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@
_logger = logging.getLogger(__name__)

from bliss.config import get_sessions_list
from bliss.config.settings import scan as rdsscan
from bliss.data.node import get_node, get_nodes
try:
from blissdata.settings import scan as rdsscan
from blissdata.data.node import get_node, get_nodes
except ImportError:
_logger.info("Trying deprecated access to Redis")
from bliss.config.settings import scan as rdsscan
from bliss.data.node import get_node, get_nodes

_NODE_TYPES = [ "channel",
"lima",
Expand Down
21 changes: 20 additions & 1 deletion package/pyinstaller/pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import subprocess
import time
import logging

import PyInstaller
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
from PyInstaller.config import CONF

Expand Down Expand Up @@ -379,7 +380,13 @@ def cleanup_cache(topdir):

def replace_module(name):
dest = os.path.join(DISTDIR, script_n[0])
target = os.path.join(dest, os.path.basename(name))
if sys.platform.startswith("darwin") and PyInstaller.__version__ >= '6.0.0':
target = os.path.join(dest, "special_modules")
if not os.path.exists(target):
os.mkdir(target)
target = os.path.join(target, os.path.basename(name))
else:
target = os.path.join(dest, os.path.basename(name))
print("source = ", name)
print("dest = ", target)
if os.path.exists(target):
Expand Down Expand Up @@ -518,6 +525,18 @@ if sys.platform.startswith("darwin"):
shutil.rmtree(dest)
os.rename(source, dest)

# relocate the special modules
special_modules_dir = os.path.join(dest, "Contents", "MacOS", "special_modules")
if os.path.exists(special_modules_dir):
source = os.path.join(special_modules_dir, "*")
dest = os.path.join(dest, "Contents", "Frameworks")
cmd = "cp -Rf %s %s" % (source, dest)
print(cmd)
os.system(cmd)
source = source[:-1]
print("deleting %s" % source)
shutil.rmtree(source)

# Pack the application
destination = os.path.join(SPECPATH, "artifacts")
if os.path.exists(destination):
Expand Down