Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The process of packaging a nested Python module with scikit-build involves the following steps:

  1. Create a setup.py file in the root directory of the package.

  2. Import the setup function from the scikit-build module.

  3. Create a setup dictionary that defines the package name, version, author, description, required packages, and any other relevant metadata.

  4. Add the following code to the setup dictionary to include the nested module:

setup(
   ...
   packages = find_packages(),
   include_package_data = True,
   ...
)

The find_packages() function will automatically search for any packages within the root folder, including any nested modules.

  1. Add any C/C++ source files or libraries required for the package.

  2. Run python setup.py sdist to create a source distribution package.

  3. Run pip install . to install the package locally.

  4. Test the package to ensure that it functions correctly.

  5. Publish the package to PyPI or another package repository as desired.

By following these steps, you can package a nested Python module with scikit-build and make it accessible as a standalone package for use in other projects.