build: Console scripts not available during build

When building, console scripts paths are not injected into the path hence console scripts are not available during build.

Example: When cmake is installed, cmake.exe is not on path, leading to error during when when cmake is invoked with subprocess.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I literally ran into this immediately after posting! 😃

I’m hitting it in https://github.com/scikit-hep/awkward-1.0/pull/683, but you can just use the cmake_example from pybind11:

docker run -it python:3.9 bash
git clone https://github.com/pybind/cmake_example
cd cmake_example
pip install build
python -m build

Will produce:

error: [Errno 2] No such file or directory: 'cmake'

The workaround I mentioned does work:

try:
    import cmake
    CMAKE = os.path.join(cmake.CMAKE_BIN_DIR, "cmake")
except ImportError:
    CMAKE = "cmake"

.... # Replace "cmake" with CMAKE in calls below

But it should be in the path.

Just released 0.2.0.