Fix Windows DLL loading for Python 3.8+ #82
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR address?
Python 3.8+ restricts DLL loading on Windows to specific directories for security. Extension module
srreal_extcannot find dependencies (libdiffpy.dll,libObjCryst.dll, Boost, GSL) installed in%CONDA_PREFIX%\Library\bin, causing import failures.What should the reviewer(s) do?
Review the Windows-specific initialization added to
__init__.pyand verify:Changes:
src/diffpy/srreal/__init__.py: Addos.add_dll_directory()call for%CONDA_PREFIX%\Library\binbefore extension importstests/test_dll_loading.py: Verify import succeeds and Windows DLL handling works across platformsExample:
Original prompt
This section details on the original issue you should resolve
<issue_title>srreal DLL not loading properly on windows</issue_title>
<issue_description>### Problem
I am getting this when I try and run tests in pdfbl-sequential on windows:
Proposed solution
Figure out why and fix it. Here is the env list: