# CMake configs for Python modules (Pytest, Sphinx, ...)

**URL:** https://discourse.cmake.org/t/cmake-configs-for-python-modules-pytest-sphinx/10955
**Category:** Community
**Created:** [June 5, 2024, 10:18pm UTC](https://discourse.cmake.org/t/cmake-configs-for-python-modules-pytest-sphinx/10955 "2024-06-05T22:18:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jeremyr](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/df705f/32.png) [@jeremyr](https://discourse.cmake.org/u/jeremyr)
#### Post date: [June 5, 2024, 10:18pm UTC](https://discourse.cmake.org/t/cmake-configs-for-python-modules-pytest-sphinx/10955/1 "2024-06-05T22:18:10Z")

</div>

Hi everyone,

As Python is one of the most popular languages, many C++ projects end up using Python bindings of some sort. Pytest and Sphinx are very popular frameworks, so many CMake modules have been written, and most projects end up including a copy of these modules or using some hardcoded paths.

In an attempt to standardize the handling of Python packages via CMake, I wrote two Python packages to manage the installation and update of CMake configs for Pytest and Sphinx:

- [GitHub - python-cmake/pytest-cmake: Pytest module for CMake](https://github.com/python-cmake/pytest-cmake)
- [GitHub - python-cmake/sphinx-cmake: Sphinx module for CMake](https://github.com/python-cmake/sphinx-cmake)

It uses the `pip` package management, providing a module for each package and automatically generating a configuration based on the package version found.

```console
> pip install pytest-cmake 
> pip install sphinx-cmake

```

Let me know what you think!
