Skip to content

Commit

Permalink
Merge pull request #2808 from SasView/main_release_branch_merged
Browse files Browse the repository at this point in the history
merged release_6.0.0 branch as agreed at call.
  • Loading branch information
butlerpd authored Feb 28, 2024
2 parents 1c5285b + 008ecd7 commit b991271
Show file tree
Hide file tree
Showing 64 changed files with 1,639 additions and 489 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,13 @@ jobs:

### Build documentation (if enabled)

- name: Install doc-building dependencies
if: ${{ matrix.docs }}
run: |
python -m pip install sphinx
- name: Build sasmodels and bumps docs
- name: Build sasmodels, sasdata, and bumps docs
if: ${{ matrix.docs }}
run: |
make -C ../bumps/doc html || true
mkdir -p ~/.sasmodels/compiled_models
make -j4 -C ../sasmodels/doc html || true
make -C ../sasdata/docs html || true
- name: Build sasview docs
if: ${{ matrix.docs }}
Expand Down Expand Up @@ -226,25 +222,11 @@ jobs:
iscc installers/installer.iss
mv installers/Output/setupSasView.exe installers/dist
- name: Sign executable and create dmg (OSX)
- name: Build sasview installer dmg file (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p DloaAcYP build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p DloaAcYP build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k DloaAcYP build.keychain
cd installers/dist
python ../../build_tools/fix_qt_folder_names_for_codesign.py SasView6.app
python ../../build_tools/code_sign_osx.py
codesign --verify --options=runtime --entitlements ../../build_tools/entitlements.plist --timestamp --deep --verbose=4 --force --sign "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView6.app
hdiutil create SasView6.dmg -srcfolder SasView6.app -ov -format UDZO
codesign -s "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView6.dmg
- name: Build sasview installer tarball (Linux)
if: ${{ matrix.installer && startsWith(matrix.os, 'ubuntu') }}
Expand All @@ -261,6 +243,26 @@ jobs:
installers/dist/sasview-pyinstaller-dist.tar.gz
if-no-files-found: ignore

- name: Sign executable and create dmg (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p DloaAcYP build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p DloaAcYP build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k DloaAcYP build.keychain
cd installers/dist
python ../../build_tools/fix_qt_folder_names_for_codesign.py SasView6.app
python ../../build_tools/code_sign_osx.py
codesign --verify --options=runtime --entitlements ../../build_tools/entitlements.plist --timestamp --deep --verbose=4 --force --sign "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView6.app
hdiutil create SasView6.dmg -srcfolder SasView6.app -ov -format UDZO
codesign -s "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView6.dmg
- name: Publish installer package
if: ${{ matrix.installer }}
uses: actions/upload-artifact@v3
Expand All @@ -272,7 +274,6 @@ jobs:
installers/dist/sasview6.tar.gz
if-no-files-found: error


test-installer:
needs: [ build-matrix ]

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
39 changes: 35 additions & 4 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()


101 changes: 101 additions & 0 deletions build_tools/release_notes/6.0.0_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
## New features
- Orientation viewer
- Corfunc refactored
- Simultaneous fitting allows for weighting scheme
- Preferences panel with display and plotting options (polydispersity and residuals plots can be hidden).
- Improved label handling on plots
- Residuals plots refactored
- PDB reader refactored
- Wedge slicer added
- Sasdata package separated
- Move to PySide6
- Python 3.11 support
- Required documentation (https://github.com/SasView/sasview/issues/2641)
- Improved documentation
- New Tutorials

## Major bug fixes:
- Handling of constraints for polydisperse parameters
- Binning and FitPage plotting of SESANS data
- Fixed 1D slit-smearing function
- Start-up speed improved
- Magnetic SLD?
- Multiplicity model?

## New models
- New broad peak model

## Anticipated for beta version
- PDB-based model saved to custom model (for S(q) calculations)?
- Batch Processing and 2D data slicing and processing for P(r)
- Local documentation generator
- Log explorer
- Send To button with replacement options


## What's Changed (This section has to be improved)
* Fix wrong number of parameters on restore in slicer module by @butlerpd in https://github.com/SasView/sasview/pull/2462
* Update README.md by @lucas-wilkins in https://github.com/SasView/sasview/pull/2466
* More changes to corfunc by @lucas-wilkins in https://github.com/SasView/sasview/pull/2463
* Modify the way perspectives are closed by @rozyczko in https://github.com/SasView/sasview/pull/2469
* Testing nightly build by @wpotrzebowski in https://github.com/SasView/sasview/pull/2465
* Add argument to convertUI that forces full UI rebuild by @krzywon in https://github.com/SasView/sasview/pull/2483
* Pyside6 merge by @rozyczko in https://github.com/SasView/sasview/pull/2478
* Remove UI conversion from run.py by @krzywon in https://github.com/SasView/sasview/pull/2511
* Reinstate math import to Plotter.py by @krzywon in https://github.com/SasView/sasview/pull/2517
* 2111 name changes in corfunc by @lucas-wilkins in https://github.com/SasView/sasview/pull/2485
* Import pytest in density calculator GUI tests by @krzywon in https://github.com/SasView/sasview/pull/2523
* 2389: Validate text/int/float inputs within the preferences panel by @krzywon in https://github.com/SasView/sasview/pull/2476
* C&S fitting widget fixes for PySide6 by @rozyczko in https://github.com/SasView/sasview/pull/2528
* Reparent QAction from QtWidget to QtGui (PySide6) by @rozyczko in https://github.com/SasView/sasview/pull/2532
* Fix for save dataset error #2533 by @rozyczko in https://github.com/SasView/sasview/pull/2534
* Rog and beta q by @smalex-z in https://github.com/SasView/sasview/pull/2535
* Lowercase PySide6 executables for Linux compatability #2542 by @ehewins in https://github.com/SasView/sasview/pull/2543
* 2541 nightly build artifact doesnt start on mac by @wpotrzebowski in https://github.com/SasView/sasview/pull/2544
* Polydisperse parameter check on model load by @rozyczko in https://github.com/SasView/sasview/pull/2553
* Log explorer fix by @smalex-z in https://github.com/SasView/sasview/pull/2545
* Syntax highlighting in Pyside6 by @rozyczko in https://github.com/SasView/sasview/pull/2562
* Avoid parenting mess by calling the widget directly by @rozyczko in https://github.com/SasView/sasview/pull/2559
* Added model reload signal on data swap by @rozyczko in https://github.com/SasView/sasview/pull/2567
* Two options to disable residuals and polydispersity distribution plots by @lozanodorian in https://github.com/SasView/sasview/pull/2558
* 2550 wedge slicer by @ehewins in https://github.com/SasView/sasview/pull/2566
* Post-v5.0.6 Release Update by @krzywon in https://github.com/SasView/sasview/pull/2536
* Use a regex for version validity check rather than integer coercion by @krzywon in https://github.com/SasView/sasview/pull/2572
* Wedge slicer minor upgrages by @ehewins in https://github.com/SasView/sasview/pull/2570
* Strip debug messages from production version of Qt console by @pkienzle in https://github.com/SasView/sasview/pull/2557
* unit conversion for gui is missing by @rozyczko in https://github.com/SasView/sasview/pull/2568
* Adjusts scale and angular range in 1D plots from WedgeSlicer by @butlerpd in https://github.com/SasView/sasview/pull/2580
* Bump scipy from 1.7.3 to 1.10.0 in /build_tools by @dependabot in https://github.com/SasView/sasview/pull/2547
* Plot2D instances are now of `Plotter2DWidget` type. Fixes #2586 by @rozyczko in https://github.com/SasView/sasview/pull/2587
* fix dialog sizes for some calculators. #2437 by @rozyczko in https://github.com/SasView/sasview/pull/2581
* Fix for getting directory name by @rozyczko in https://github.com/SasView/sasview/pull/2596
* Remove Unused Dependency: h5py by @gdrosos in https://github.com/SasView/sasview/pull/2585
* 2577 orientation viewer doesnt work from nigthly build on mac by @lucas-wilkins in https://github.com/SasView/sasview/pull/2600
* Fixed unmatched method signatures in Box&Wedge Interactor child classes by @ehewins in https://github.com/SasView/sasview/pull/2589
* Particle editor by @lucas-wilkins in https://github.com/SasView/sasview/pull/2520
* Pass the Data1D/2D object, not its `data` attribute by @rozyczko in https://github.com/SasView/sasview/pull/2592
* Bump reportlab from 3.6.6 to 3.6.13 in /build_tools by @dependabot in https://github.com/SasView/sasview/pull/2597
* Added 3.11, removed 3.8 by @rozyczko in https://github.com/SasView/sasview/pull/2582
* Fix doc build errors by @smk78 in https://github.com/SasView/sasview/pull/2607
* Doc toctree fixes by @smk78 in https://github.com/SasView/sasview/pull/2609
* 2603: Numeric coercion in preferences by @krzywon in https://github.com/SasView/sasview/pull/2605
* What's new dialog by @lucas-wilkins in https://github.com/SasView/sasview/pull/2608
* created submenu for slicers being part of #2604 by @astellhorn in https://github.com/SasView/sasview/pull/2610
* Squish squashed by @lucas-wilkins in https://github.com/SasView/sasview/pull/2616
* Update sas_gen.py by @timsnow in https://github.com/SasView/sasview/pull/2617
* Killed Zombie Python Test by @lucas-wilkins in https://github.com/SasView/sasview/pull/2627
* Remove model.png by @lucas-wilkins in https://github.com/SasView/sasview/pull/2629
* Populate whats new with last version by @smk78 in https://github.com/SasView/sasview/pull/2625
* Fix errors while running convertUI by @krzywon in https://github.com/SasView/sasview/pull/2623
* 2618: Fix GPU and Optimizer Preferences by @krzywon in https://github.com/SasView/sasview/pull/2622
* Moving OSX signing to nightly by @wpotrzebowski in https://github.com/SasView/sasview/pull/2631
* Empty lines in data explorer by @rozyczko in https://github.com/SasView/sasview/pull/2643

## New Contributors
* @smalex-z made their first contribution in https://github.com/SasView/sasview/pull/2535
* @ehewins made their first contribution in https://github.com/SasView/sasview/pull/2543
* @lozanodorian made their first contribution in https://github.com/SasView/sasview/pull/2558
* @gdrosos made their first contribution in https://github.com/SasView/sasview/pull/2585
* @astellhorn made their first contribution in https://github.com/SasView/sasview/pull/2610

**Full Changelog**: https://github.com/SasView/sasview/compare/nightly-build...v6.0.0-alpha
1 change: 1 addition & 0 deletions build_tools/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ zope
superqt
pyopengl
pyopengl_accelerate
sphinx
49 changes: 36 additions & 13 deletions docs/sphinx-docs/build_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
from distutils.util import get_platform
from distutils.spawn import find_executable

from shutil import copy
from os import listdir
from sas.system.user import get_user_dir

platform = '.%s-%s'%(get_platform(),sys.version[:3])

Expand All @@ -39,6 +38,8 @@
SASVIEW_BUILD = joinpath(SASVIEW_ROOT, "build", "lib")
SASVIEW_MEDIA_SOURCE = joinpath(SASVIEW_ROOT, "src", "sas")
SASVIEW_DOC_TARGET = joinpath(SASVIEW_BUILD, "doc")
SASVIEW_DOC_SOURCE = joinpath(SASVIEW_DOC_TARGET, "source-temp")
SASVIEW_DOC_BUILD = joinpath(SASVIEW_DOC_TARGET, "build")
SASVIEW_API_TARGET = joinpath(SPHINX_SOURCE, "dev", "sasview-api")

# sasmodels paths
Expand All @@ -57,6 +58,15 @@
"index.rst", "install.rst", "intro.rst",
]

# sasdata paths
SASDATA_ROOT = joinpath(SASVIEW_ROOT, "..", "sasdata")
SASDATA_DOCS = joinpath(SASDATA_ROOT, "docs")
SASDATA_BUILD = joinpath(SASDATA_ROOT, "build", "lib")
SASDATA_DEV_SOURCE = joinpath(SASDATA_DOCS, "source", "dev")
SASDATA_DEV_TARGET = joinpath(SPHINX_SOURCE, "dev", "sasdata-dev")
SASDATA_GUIDE_SOURCE = joinpath(SASDATA_DOCS, "source", "user")
SASDATA_GUIDE_TARGET = joinpath(SPHINX_SOURCE, "user", "data")

# bumps paths
BUMPS_DOCS = joinpath(SASVIEW_ROOT, "..", "bumps", "doc")
BUMPS_SOURCE = joinpath(BUMPS_DOCS, "guide")
Expand Down Expand Up @@ -154,6 +164,15 @@ def retrieve_user_docs():
inplace_change(joinpath(catdir, filename), "../../model/", "/user/models/")


def retrieve_sasdata_docs():
"""
Copies select files from the bumps documentation into fitting perspective
"""
print("=== Sasdata Docs ===")
copy_tree(SASDATA_DEV_SOURCE, SASDATA_DEV_TARGET)
copy_tree(SASDATA_GUIDE_SOURCE, SASDATA_GUIDE_TARGET)


def retrieve_bumps_docs():
"""
Copies select files from the bumps documentation into fitting perspective
Expand Down Expand Up @@ -247,27 +266,31 @@ def build():
"""
Runs sphinx-build. Reads in all .rst files and spits out the final html.
"""
copy_tree(SPHINX_SOURCE, SASVIEW_DOC_SOURCE)
print("=== Build HTML Docs from ReST Files ===")
subprocess.check_call([
"sphinx-build",
"-v",
"-b", "html", # Builder name. TODO: accept as arg to setup.py.
"-d", joinpath(SPHINX_BUILD, "doctrees"),
"-W", "--keep-going",
SPHINX_SOURCE,
joinpath(SPHINX_BUILD, "html")
])
try:
subprocess.check_call([
"sphinx-build",
"-v",
"-b", "html", # Builder name. TODO: accept as arg to setup.py.
"-d", joinpath(SPHINX_BUILD, "doctrees"),
"-W", "--keep-going",
SPHINX_SOURCE,
joinpath(SPHINX_BUILD, "html")
])
except Exception as e:
print(e)

print("=== Copy HTML Docs to Build Directory ===")
html = joinpath(SPHINX_BUILD, "html")
copy_tree(html, SASVIEW_DOC_TARGET)

copy_tree(html, SASVIEW_DOC_BUILD)

def rebuild():
clean()
setup_source_temp()
retrieve_user_docs()
retrieve_bumps_docs()
retrieve_sasdata_docs()
apidoc()
build()
if find_executable('latex'):
Expand Down
7 changes: 6 additions & 1 deletion docs/sphinx-docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@
'sphinx.ext.mathjax',
#'mathjax', # replacement mathjax that allows a list of paths
'dollarmath',
'sphinx.ext.viewcode']
#'sphinx.ext.viewcode',
]

no_highlight = os.environ.get('SAS_NO_HIGHLIGHT', '0') # Check if sphinx highlighting is disabled in this environment
if no_highlight == '1':
extensions.append('sphinx.ext.viewcode')

mathjax_path = (
'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?'
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx-docs/source/dev/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Contents
SasView API <sasview-api/modules>
sasmodels overview <sasmodels-dev/index>
sasmodels API <sasmodels-api/modules>
sasdata overview <sasdata-dev/dev>
OpenGL subsystem <gl/opengl.rst>

Indices and Search
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx-docs/source/user/working.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Working with SasView
.. toctree::
:maxdepth: 1

Data Formats <qtgui/MainWindow/data_formats_help>
Data Formats <data/data/data_formats_help>

Loading Data <qtgui/MainWindow/data_explorer_help>

Plotting Data/Models <qtgui/MainWindow/graph_help>

Test Data <example_data/testdata_help>
Example Data <example_data/testdata_help>

Tutorials <tutorial>

Expand Down
4 changes: 3 additions & 1 deletion installers/sasview.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ datas = [
('../src/sas/qtgui/Utilities/WhatsNew/messages', 'sas/qtgui/Utilities/WhatsNew/messages'),
('../src/sas/system/log.ini', 'sas/system/'),
('../../sasmodels/sasmodels','sasmodels'),
('../docs/sphinx-docs/build/html','doc')
('../docs/sphinx-docs/build','doc/build'),
('../docs/sphinx-docs/source-temp','doc/source')
]
#TODO: Hopefully we can get away from version specific packages
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'))

def add_data(data):
for component in data:
Expand Down
Loading

0 comments on commit b991271

Please sign in to comment.