Skip to content

Install the Python module and binaries with pip - #24

Merged
mikelangmayr merged 3 commits into
mainfrom
mike/python-packaging
Sep 16, 2026
Merged

mikelangmayr merged 3 commits into
mainfrom
mike/python-packaging

Conversation

@mikelangmayr

Copy link
Copy Markdown
Contributor

Stacked on #23, so the diff shows only the packaging work. Retarget to main once #23 merges.

  • Add pyproject.toml using scikit-build-core, so pip install ./camera-interface compiles camera_interface into site-packages and puts camerad and its tools on the environment's PATH. CONTROLLER defaults to archon and BUILD_PYTHON_MODULE is forced on; any other CMake option passes through as --config-settings=cmake.define.X=Y
  • pybind11 moves into [build-system] requires, so pip fetches it into an isolated build environment rather than the user installing it by hand
  • Derive PROJECT_BASE_DIR from CMAKE_CURRENT_SOURCE_DIR instead of $ENV{PWD}/../. A build backend invokes cmake with cwd=, which does not update PWD, so the old form failed the configure outright with add_subdirectory given source "/tmp/..//camerad". Identical for the existing cd build && cmake .. flow
  • Send install rules to SKBUILD_SCRIPTS_DIR/SKBUILD_PLATLIB_DIR under a wheel build and to the GNU prefix layout otherwise, since a wheel needs the module importable as a top-level name and the binaries on PATH
  • Keep CMake's outputs in the build directory under a wheel build, so a pip install does not write into the source tree's bin/
  • Document the pip flow in the README
  • Verified by pip install into a scratch venv: the module imports from site-packages with PYTHONPATH unset and reports hispec_tracking_camera/archon, and open, load, power on, expose 1 all return DONE against the emulator using only the venv's binaries

Base automatically changed from mike/install-rules to main September 16, 2026 18:43
@mikelangmayr
mikelangmayr merged commit 021cb17 into main Sep 16, 2026
4 checks passed
@mikelangmayr
mikelangmayr deleted the mike/python-packaging branch September 16, 2026 21:32
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