Skip to content

Commit

Permalink
[Docs] document environment variables that affect the py-build-cmake …
Browse files Browse the repository at this point in the history
…behavior
  • Loading branch information
tttapa committed Feb 3, 2025
1 parent bc4db25 commit fa93fa3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Variables

## Variables that are set by py-build-cmake

Below is a list of the CMake variables and environment variables that are set
by py-build-cmake during the build process.

Expand All @@ -20,3 +22,18 @@ by py-build-cmake during the build process.
| `PY_BUILD_CMAKE_PYTHON_VERSION_PATCH` | Patch version number of the Python interpreter that was used to invoke py-build-cmake ([`sys.version_info.micro`](https://docs.python.org/3/library/sys.html#sys.version_info)). | CMake |
| `PY_BUILD_CMAKE_PYTHON_RELEASE_LEVEL` | Release level of the Python interpreter that was used to invoke py-build-cmake ([`sys.version_info.releaselevel`](https://docs.python.org/3/library/sys.html#sys.version_info)). | CMake |
| `PY_BUILD_CMAKE_ABIFLAGS` | The ABI flags of the Python interpreter that was used to invoke py-build-cmake ([`sys.abiflags`](https://docs.python.org/3/library/sys.html#sys.abiflags)). | CMake |

## Environment variables that affect the behavior of py-build-cmake

| Variable | Description |
|:---------|:------------|
| `PY_BUILD_CMAKE_VERBOSE` | Enables verbose mode: prints more information about the py-build-cmake configuration, options passed to CMake, etc. Equivalent to passing the `--verbose` config option. |
| `PY_BUILD_CMAKE_LOGLEVEL` | Sets the level of the root logger. Can be used to silence all notifications or warnings. See https://docs.python.org/3/library/logging.html#levels for a list of valid levels. Equivalent to passing the `--loglevel` config option. |
| `GITHUB_RUN_ATTEMPT` | If this value is greater than one, automatically enables verbose mode. Explicitly set `PY_BUILD_CMAKE_VERBOSE` to `false` to disable this behavior. |
| `NO_COLOR` | Disables color output of the command line interface. |
| `CLICOLOR_FORCE` | Enable color output of the command line interface, even if not connected to a TTY. |
| `_PYTHON_HOST_PLATFORM` | Overrides the Python platform tag used for Wheel filenames. Note that this only changes the tag, it does not actually affect the build process. |
| `DIST_EXTRA_CONFIG` | On Windows, this variable can be set to the path of a configuration file that may contain the `build_ext.plat_name` and `build_ext.library_dirs` options. Support is limited to basic compatibility with cibuildwheel. See [Cross-compilation § Windows](https://tttapa.github.io/py-build-cmake/Cross-compilation.html#windows) for details. |
| `ARCHFLAGS` | On macOS, this variable can be set to enable automatic cross-compilation or to build universal2 Wheels. Possible values: `-arch x86_64`, `-arch arm64` or `-arch x86_64 -arch arm64`. See [Cross-compilation § macOS](https://tttapa.github.io/py-build-cmake/Cross-compilation.html#macos) for details. Affects the platform tag of the generated Wheels, and passes the value on to CMake. |
| `MACOSX_DEPLOYMENT_TARGET` | Selects the macOS version to build for. Affects the platform tag of the generated Wheels, and passes the value on to CMake. Values should contain a major and minor version, separated by a dot. For example, `15.4`. |
| `SOURCE_DATE_EPOCH` | Setting this to a Unix timestamp causes py-build-cmake to perform a [reproducible build](https://reproducible-builds.org/docs/source-date-epoch). The modification times of files in the generated sdist and Wheel archives are set to the given value. |

0 comments on commit fa93fa3

Please sign in to comment.