Skip to content

Add dll binary path for cadet core pypi distribution#78

Merged
hannahlanzrath merged 4 commits into
masterfrom
add_dll_binary_path_for_cadet_core_pypi_distribution
Jun 24, 2026
Merged

Add dll binary path for cadet core pypi distribution#78
hannahlanzrath merged 4 commits into
masterfrom
add_dll_binary_path_for_cadet_core_pypi_distribution

Conversation

@hannahlanzrath

@hannahlanzrath hannahlanzrath commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes and add tests for #77

When this PR is merged we should to a bug fix release!

Summary

Make CADET-Python correctly find the CADET-Core DLL when installed via the cadet-core PyPI package (not just conda), and add CI coverage for that install path.

  1. cadet/cadet.py : resolve_cadet_paths now falls back to the cadet_core package's own directory (Path(cadet_core.__file__).parent) to locate the shared library whenever it isn't found under the originally-resolved root. This handles two PyPI problems: binaries nested inside site-packages/cadet_core/ rather than at the venv root, and (discovered via CI) cadet-cli/createLWE console scripts sometimes living in a completely different prefix than the cadet_core package itself (seen on macOS GH Actions runners). Also added the SONAME-versioned libcadet.0.dylib as a fallback filename on macOS.

  2. tests/test_cadet.py : new test_create_lwe_and_run_cli_smoke, parametrized over the conda-autodetected install and the cadet-core PyPI install (skipped via pytest.importorskip if cadet_core isn't present). Runs create_lwe() + run_simulation() and checks for a clean return code.

  3. .github/workflows/pipeline.yml : new test-pypi-job: a plain-Python (no conda) matrix job that pip installs CADET-Python + cadet-core and runs the test suite, exercising the PyPI install path end-to-end across Linux/Windows/macOS.

  4. tests/test_install_path_settings.py : relaxed test_autodetection to check that cadet_dll_path/cadet_cli_path exist rather than asserting they share a parent directory with the install root, since that invariant doesn't hold for PyPI installs where the dll and the console scripts can live under different prefixes.

@hannahlanzrath hannahlanzrath force-pushed the add_dll_binary_path_for_cadet_core_pypi_distribution branch 2 times, most recently from 28b8c5f to 87bea92 Compare June 24, 2026 09:40
@hannahlanzrath hannahlanzrath requested a review from jbreue16 June 24, 2026 09:49
@hannahlanzrath hannahlanzrath force-pushed the add_dll_binary_path_for_cadet_core_pypi_distribution branch from bdd334e to 0196ee3 Compare June 24, 2026 09:50
@hannahlanzrath hannahlanzrath force-pushed the add_dll_binary_path_for_cadet_core_pypi_distribution branch from 0196ee3 to f738aee Compare June 24, 2026 10:16
@hannahlanzrath hannahlanzrath force-pushed the add_dll_binary_path_for_cadet_core_pypi_distribution branch from f738aee to 67e4380 Compare June 24, 2026 10:20

@jbreue16 jbreue16 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix works for me,

from cadet import Cadet

c = Cadet()

print("DLL:", c.cadet_dll_path)
print("CLI:", c.cadet_cli_path)

prints None for the DLL on master, but gives a correct path with this branch

@hannahlanzrath hannahlanzrath merged commit a4aeb1d into master Jun 24, 2026
9 checks passed
@hannahlanzrath hannahlanzrath deleted the add_dll_binary_path_for_cadet_core_pypi_distribution branch June 24, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants