Running pip install . (or any build command) causes CMake's configure_file step to generate src/bindings.cpp directly inside the source tree. This file is a build artifact derived from src/bindings.cpp.in and should not appear in the working directory. In CMakeList.txt
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp.in
${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp)
The output path uses CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_CURRENT_BINARY_DIR, so the generated file lands in the source tree rather than the build directory. Additionally, .gitignore lists src/osqp/bindings.cpp instead of src/bindings.cpp, so the file is not ignored.