Closed ahnaf-tahmid-chowdhury closed 2 weeks ago
I think this is one of the reasons we should move to a src/openmc
layout instead of the current openmc
folder layout. I think python imports from the folder if found before looking for packages with that name
Thanks @ahnaf-tahmid-chowdhury for reporting. This is a known issue and duplicate of #1226 so I'll close this out but please continue to discuss there. As @shimwell said, the easy solution is to move to a src
layout but that may be a bit disruptive with the current number of pending PRs we have.
@ahnaf-tahmid-chowdhury if it makes the scikit core pip install easier then we can do this src folder layout on that branch and see how it goes
Description
I am encountering an issue where, during the execution of
pytest
, the tests are using the OpenMC source folder rather than the installed version of OpenMC from the wheel package. As a result,libopenmc.so
is not found, since it is no longer available in the source directory (after removing it in the recent updates to copy it from the build directory). I expectedpytest
to run against the installed wheel version of OpenMC, which includes all dependencies (includinglibopenmc.so
).Reproduction Steps
scikit-build-core
andmanylinux
to create a wheel package that includes all dependencies (includinglibopenmc.so
). PR #3087pip install
.pytest
for testing.Expected Behavior
The tests should use the installed version of OpenMC from the wheel package, which includes
libopenmc.so
.Observed Behavior
Instead,
pytest
uses the OpenMC source directory, wherelibopenmc.so
is missing. This leads to anOSError
as shown below:Investigation
I have confirmed that the installed wheel package is working correctly by running OpenMC notebooks, which operate with the installed version of OpenMC without any issues. However, when running tests with
pytest
, it always defaults to the OpenMC source folder.Renaming the
openmc
source folder to something else causes the tests to stop working, which indicates thatpytest
is not using the installed version but the source directory.Additional Information
Any additional guidance on configuring
pytest
to properly use the installed version of OpenMC would be appreciated.