Repository navigation
build(python): build platform wheels that carry the native library - #42
Conversation
The cabledyn package was published only as a pure-Python wheel: it loads the CableDyn shared library and runs the standalone driver, but the user had to build or download both separately. This prepares publication on PyPI. A root pyproject.toml (scikit-build-core) builds an sdist of the sources and a platform wheel. CMake builds only the cabledyn_shared and cabledyn targets, serially, and under scikit-build installs them through the `python` component: the library beside the package modules, where cabledyn._discovery already looks first, and the driver in cabledyn/bin. The wheel is tagged py3-none-<platform>, since the package reaches the library through ctypes. The sdist leaves out the validation records, the manual, the OpenFAST integration and the release tooling, and builds a wheel on its own. The driver search takes the bundled driver after CABLEDYN_DRIVER and before PATH, under either toolchain name (CableDyn_driver, cabledyn). python/pyproject.toml stays the pure package for development against a build tree; tests/test_packaging_metadata.py keeps the two [project] tables identical except for the readme, licence files and platform classifiers, and the release checks cover the new file. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 312179fd50
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # wheel repair tools bundle the runtime and LAPACK libraries they need. | ||
| install(TARGETS cabledyn_shared | ||
| RUNTIME DESTINATION cabledyn COMPONENT python | ||
| LIBRARY DESTINATION cabledyn COMPONENT python) | ||
| install(TARGETS cabledyn RUNTIME DESTINATION cabledyn/bin COMPONENT python) |
There was a problem hiding this comment.
Explicitly bundle the runtime-loaded OpenBLAS DLL
For the documented GNU/conda Windows toolchain, CMake enables CABLEDYN_BLAS_RUNTIME_LOAD, which deliberately removes OpenBLAS from the binaries' imports; src/cabledyn_blas.c instead loads openblas.dll by name at runtime. The new python component installs only the two CableDyn binaries, while the existing runtime-DLL installation belongs to a different component. Consequently, ordinary import-table-based wheel repair will not discover this dependency, and the resulting wheel cannot initialize models on a clean Windows machine without OpenBLAS on PATH. Explicitly include this runtime dependency and arrange for both the packaged library and driver to find it rather than relying solely on automatic wheel repair.
Useful? React with 👍 / 👎.
Summary
First step towards publishing
cabledynon PyPI (and conda-forge).The problem. The package was published only as a pure-Python wheel. It loads the CableDyn shared library and runs the standalone driver, but users had to build or download both separately.
What changes:
pyproject.toml(scikit-build-core) builds the published distribution:cabledyn._discoveryalready looks first) and the standalone driver incabledyn/bin;cabledyn_sharedandcabledyntargets, installed through apythoninstall component that is active only under scikit-build; no test programs, and no OpenMP (CABLEDYN_ENABLE_OPENMPoff, like the release executables);py3-none-<platform>; the package reaches the library throughctypes, so one wheel per platform serves every supported Python version;CABLEDYN_DRIVERand beforePATH. It accepts either toolchain's name (CableDyn_driverfor MSVC-style linkers,cabledynfor GNU).python/pyproject.tomlremains the pure package for development against a build tree.tests/test_packaging_metadata.pykeeps the two[project]tables identical, except for the readme, the licence files (the wheel also shipsNOTICE) and the platform classifiers.release/check_release_metadata.pyandrelease/audit_release_tree.pycover the new file.DEVELOPMENT.mddocuments local sdist and wheel builds; CHANGELOG entry.Next PRs:
Verification (local, Windows, conda GNU toolchain)
pip wheel .givescabledyn-…-win_amd64.whlcontainingcabledyn/libcabledyn.dllandcabledyn/bin/cabledyn.exe. Installed into a fresh virtual environment and used from outside the repository, the package:examples/dynamic_chain_current.dat.python -m build --sdistproduces 523 entries with no bytecode, and a wheel builds from the sdist alone.PATH,CABLEDYN_DRIVERbefore bundled), both driver names, and the metadata parity;pre-commit run --all-filesand the Sphinx build with-Wpass.Checklist
pre-commit run --all-filespassesctest --test-dir build --output-on-failurepassespython -m pytest tests python/testspasses (if Python or validation records changed)[Unreleased](heading added if missing) for user-visible changesdoc/updated for changed inputs, options, or outputs (the user-facing install instructions change with the first PyPI release)feat:,fix:,docs:, ...)git commit -s) under theDeveloper Certificate of Origin