Skip to content

Commit

Permalink
Merge branch 'release_6.0.0' into 2689-improve-documentation-for-sld-…
Browse files Browse the repository at this point in the history
…calculator
  • Loading branch information
butlerpd committed Mar 8, 2024
2 parents 8a3e1fb + 9305f5a commit e19905b
Show file tree
Hide file tree
Showing 135 changed files with 226 additions and 197,456 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
rm -rf dist
python setup.py clean
python setup.py build
mv build/lib/sasdata/example_data/* ../sasview/src/sas/example_data/
python -m pip install --no-deps .
- name: Build and install sasmodels
Expand Down
3 changes: 2 additions & 1 deletion INSTALL.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Quick Intro for Building Sasview
================================

Note - at the current time sasview will only run in gui form under Python 3.
Note - at the current time sasview will only run in gui form under Python 3.11
and later.

Before trying to install and run sasview you'll need to check what
dependencies are required:
Expand Down
37 changes: 34 additions & 3 deletions build_tools/code_sign_osx.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,44 @@
"SasView*.app/Contents/Resources/zmq/.dylibs/*.dylib", recursive=True
)

pyside_QtWebEngineProcessApp = glob.glob(
"SasView*.app/Contents/Resources/PySide6/Qt/lib/QtWebEngineCore.framework/Versions/A/Helpers/QtWebEngineProcess.app", recursive=True
)

pyside_QtWebEngineCore = glob.glob(
"SasView*.app/Contents/Resources/PySide6/Qt/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore", recursive=True
)

pyside_QtWebEngineProcess_Helpers = glob.glob(
"SasView*.app/Contents/Resources/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess", recursive=True
)

pyside_Qtlibs = glob.glob(
"SasView*.app/Contents/Resources/PySide6/Qt/lib/Qt*.framework/Versions/A/Qt*", recursive=True
)

#pyside_libs = pyside_QtWebEngineCore + pyside_QtWebEngineProcess

sign_command = ['codesign', '--timestamp', '--options=runtime', '--verify', '--verbose=4', '--force',
'--sign', 'Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)']
'--sign', 'Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)']

sign_deep_command = ['codesign', '--timestamp', '--deep', '--options=runtime', '--verify', '--verbose=4', '--force',
'--sign', 'Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)']

#TODO: Check if it is necesarry to do it per file (one long list maybe enough)
for sfile in itertools.chain(so_list, dylib_list, dylib_list_resources, zmq_dylib_list_resources):
#Signing QtWebEngineProcess.app first as it is a helper app
for sfile in itertools.chain(pyside_QtWebEngineProcessApp):
sign_deep_command.append(sfile)
subprocess.check_call(sign_deep_command)
sign_deep_command.pop()

for sfile in itertools.chain(so_list, dylib_list,
dylib_list_resources,
zmq_dylib_list_resources,
pyside_QtWebEngineCore,
pyside_QtWebEngineProcess_Helpers,
pyside_Qtlibs):
sign_command.append(sfile)
subprocess.check_call(sign_command)
sign_command.pop()


4 changes: 2 additions & 2 deletions docs/sphinx-docs/build_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os
from os.path import join as joinpath, abspath, dirname, isdir, exists, relpath
import shutil
import imp
from importlib.machinery import SourceFileLoader

from glob import glob
from distutils.dir_util import copy_tree
Expand Down Expand Up @@ -73,7 +73,7 @@
BUMPS_TARGET = joinpath(SPHINX_PERSPECTIVES, "Fitting")


run = imp.load_source('run', joinpath(SASVIEW_ROOT, 'run.py'))
run = SourceFileLoader('run', joinpath(SASVIEW_ROOT, 'run.py')).load_module()
run.prepare()


Expand Down
2 changes: 1 addition & 1 deletion installers/sasview.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ datas = [
datas.append((os.path.join(PYTHON_PACKAGES, 'debugpy'), 'debugpy'))
datas.append((os.path.join(PYTHON_PACKAGES, 'jedi'), 'jedi'))
datas.append((os.path.join(PYTHON_PACKAGES, 'zmq'), 'zmq'))
datas.append((os.path.join(PYTHON_PACKAGES, 'freetype'), 'freetype'))
# datas.append((os.path.join(PYTHON_PACKAGES, 'freetype'), 'freetype'))

def add_data(data):
for component in data:
Expand Down
18 changes: 12 additions & 6 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ def prepare():
# Find the directories for the source and build
root = abspath(dirname(realpath(__file__)))

# TODO: Do we prioritize the sibling repo or the installed package?
# TODO: Can we use sasview/run.py from a distributed sasview.exe?
# Put supporting packages on the path if they are not already available.
for sibling in ('periodictable', 'bumps', 'sasdata', 'sasmodels'):
try:
import_module(sibling)
except:
addpath(joinpath(root, '..', sibling))
# run.py is only used by developers. The sibling directory should be the priority over installed packages.
# This allows developers to modify and use separate packages simultaneously.
devel_path = joinpath(root, '..', sibling)
if os.path.exists(devel_path):
addpath(devel_path)
else:
try:
import_module(sibling)
except ImportError:
raise ImportError(f"The {sibling} module is not available. Either pip install it in your environment or"
f" clone the repository into a directory level with the sasview directory.")


# Put the source trees on the path
addpath(joinpath(root, 'src'))
Expand Down
Loading

0 comments on commit e19905b

Please # to comment.