Skip to content

Support for missing setup.py on startup #515

@stellaraccident

Description

@stellaraccident

Thanks for a great tool - saved me a bunch of time on a couple of projects.

I'm running in to an issue where the result of our build system is a package directory containing a setup.py, which creates a chicken-and-egg problem with cibuildwheel.

I'm doing this:

          package_dir="./iree-install/python_packages/iree_rt"
          export CIBW_BEFORE_BUILD="rm -f ./iree-build/CMakeCache.txt && \
            rm -Rf ./iree-install && \
            python ./main_checkout/build_tools/cmake/cmake_configure_ci.py \
            -B./iree-build -DCMAKE_INSTALL_PREFIX=./iree-install \
            -DCMAKE_BUILD_TYPE=Release \
            -DIREE_BUILD_COMPILER=OFF \
            -DIREE_BUILD_PYTHON_BINDINGS=ON \
            -DIREE_BUILD_SAMPLES=OFF && \
            cmake --build ./iree-build --target install/strip"
          # TODO: cibuildwheel sanity checks this, but our setup.py is the
          # *output* of the build :( File a bug.
          mkdir -p $package_dir && touch $package_dir/setup.py
          python -m cibuildwheel --output-dir wheelhouse $package_dir

I peeked in the source and it looked like the exist check at the top for a valid package file was just a sanity check, so I touched it before invoking to bypass. The result of the CIBW_BEFORE_BUILD will produce it. I verified this works, and due to a bug, I was also not generating valid packages on the first try, and I verified then that the error message downstream when this happens is reasonable (it suggests that a setup file is missing).

Can we just remove the check or at least downgrade it to an informational message?

Also, would be lovely at some point if I could pass multiple package directories and have them built in sequence. Our build system can produce multiple packages and I'm currently having to duplicate build things in a matrix and package them one by one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions