You would generate the C files during the first CMake call (configure time or build time, does not really matter that much ), then you call the PEP517 frontend. So for pure python packages, you create the structure in CMAKE_BINARY_DIR tree with the module.py, pyproject.toml, _init_.py and any namespacing directory structure and just call the PEP517 frontend as custom target.įor Cython you would use the CMake-to-PEP517Backend-to-CMake call structure. (You can use Wheel2Deb to turn a wheel into deb, for example.) Once you have a wheel, you can turn it in other formats. Modern Python packaging pretty much requires the use of wheels for normal distribution and sdists for people who really needs to rebuild locally or for some other special cases. What I decided on doing in my project is just let Python tooling do its thing. Should I just call the standard Setuptools build from CMAKE and create the pyproject.tomls and setup.cfgs as templated files? Is there any recommendation for PEP517+PEP518 using CMAKE? I have seen something like it mentioned for Meson and SCons. I want for CMAKE to stay the main driving force as the Python part should be only an option. All project I have seen, like scikit-build or others on Github are wrapping CMAKE in Python Setuptools (or Distutils). Testing in virtual environment against multiple versions, source layout, building wheels, source distribution and native Linux distributions packages. (Plus I would like to leave the doors open for possible other languages in the future.) The Python part is Cython wrappers around the C code, Python C extension library (which could be in due time rewritten in Cython), modules (libraries and executable) which build on these wrappers and then some pure Python modules included just as examples or additional resources (all have logical connection to the core project).Īnd now I am wondering, how I should implement in CMAKE, so I am using the latest Python advancement and procedures. The main part is written in C and consists of several libraries and executables, some additional parts are written in C++, bash and Python. I am researching a current, modern ways how to implement CMAKE based build system for my project which is currently based on handwritten makefiles.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |