mantidproject / mantidimaging

Graphical toolkit for neutron imaging.
https://mantidproject.github.io/mantidimaging
GNU General Public License v3.0
13 stars 6 forks source link

Exclude builtin test.support modules from being loaded with Operation Modules #2299

Closed MikeSullivan7 closed 2 months ago

MikeSullivan7 commented 2 months ago

Issue

Closes #2298

Description

In both mantidimaging/core/operations/loader.py and packaging/PackageWithPyInstaller.py we now check if the module name aligns with that in the builtin test modules and exclude it if it does.

Testing

make check

Acceptance Criteria

rebuild dev env make a Windows build via packaging/PackageWithPyInstaller.py check that the Windows build does not contain any AssertionErrors related to the Operations modules.

Documentation

release note

coveralls commented 2 months ago

Coverage Status

coverage: 73.051% (-0.02%) from 73.069% when pulling cda45da9599293886adc4c6840683b558a59019f on 2298_prevent_builtin_tests_hidden_import into ae9b13675ad09a024423a3d481aeb9cc2450ad98 on main.

samtygier-stfc commented 2 months ago

I am seeing this again. It should have been fixed by #2276 and I see it on main too, so its not a regression from this PR.

Traceback (most recent call last):
  File "mantidimaging/__main__.py", line 16, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
  File "mantidimaging/main.py", line 17, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
  File "mantidimaging/core/__init__.py", line 5, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
  File "mantidimaging/core/io/__init__.py", line 5, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
  File "mantidimaging/core/io/saver.py", line 10, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
  File "h5py/__init__.py", line 25, in <module>
ImportError: /home/sam/git/mantidimaging/packaging/dist/MantidImaging/_internal/libssl.so.3: version `OPENSSL_3.2.0' not found (required by /home/sam/git/mantidimaging/packaging/dist/MantidImaging/_internal/./libcurl.so.4)
[1367507] Failed to execute script '__main__' due to unhandled exception

If you are happy that this improves things on windows I'll merge it, the openssl probably can be a separate issue.

samtygier-stfc commented 2 months ago

With the coping libraries into dist kludge from #2300 I can confirm the issue and the fix on linux.