-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use cibuildwheel under this "unusual" setup #13
Comments
cibuildwheel does take a project path, like
But in your case, this is going to be a problem because cibuildwheel mounts the project folder on Linux, so the build machine will only have access to the python folder, not the sibling folders. I can't think of an easy solution we could make... maybe it would work if you moved the setup.py to the root of the repo and build from there? |
If cibuildwheel would not look for a setup.py file when attempting to mount the project folder, I could import the whole repo and add e.g. |
By the way moving setup.py to the root of the repo is a possibility |
Ah, the pre-build command executes in a subshell, so cd'ing won't affect the working dir. |
I'm not sure I'm following. Is that good? |
Sorry, I mean cd'ing won't work the way you're thinking because it won't change cibuildwheel's working dir. |
I see.
Can you tell me more about the not so easy solution? Is it related to docker or more of a python limitation? |
@sgeto I don't think your project setup is uncommon - it just isn't primarily a python package. cibuildwheel is still in early stages so I imagine these kind of use cases likely haven't come up yet. Anyway, just to rephrase the issue you're having: Your setup.py is not in your root folder. cibuildwheel doesn't currently support this configuration as it expects everything required to be contained under the directory where setup.py is located. In the future it probably makes sense to directly support configurations like yours - perhaps by allowing passing of additional options to docker and/or allowing a custom path for setup.py. But as a temporary workaround...if you moved your setup.py to your root project folder (and made the necessary changes to your setup.py) would that fix your issue? |
@tgarc moving the setup.py file to für root directory fixes the issue. |
Glad to hear that worked. (If I'm understanding you right.) Maybe adding a CIBW_SETUP_DIR to specify a folder containg setup.py that is different from the root would help in cases like yours. |
It did, thanks. |
I'm closing this out for now. Thanks @tgarc, I think Comment below if this is a feature you'd find useful for your project! |
Hi, I got into similar issue recently. Is there anyway to implement |
I have a feeling you wouldn't be helped by it. Lots of other parts of the tooling including pip will assume the root directory contains all the code and will copy it before building. I think your best bet is to put the project files at the top level (in a before-all script if you can't physically move them). Does your SDist work? You should have a working SDist if possible. |
My project consists of several packages and several build actions. This means that I have setup.py and pyproject.toml in a subdirectory. I would also like to be able to say: @cibuildwheel, please cd to “xx/yy/ first and then start. |
I was able to successfully test this workaround for my problem. In the GitHub action, I revised the checkout as follows. Thus, the desired subdirectory is the root directory of CIBuildWheels:
|
Hi @joerick
I could use some help.
The wheels I'm trying to build are a binding for a C library. The
setup.py
file is located in a sub folder (python) where the python build takes place (as part of the overall build or seperatly).However, during build the compiler needs access to additional header and source file located in other sub folders (src include) located on the same level as the python folder.
cibuildwheel seems to only import the folder holding the setup.py file. And the build sadly fails. I tried everything. Setting global environment variables, adding the whole
src
for as project and adding cibuildwheel pre-build commands.How can I use cibuildwheel in such a setup?
Thanks a lot
Project: https://github.com/sgeto/libdnet
Travis: https://travis-ci.org/sgeto/libdnet/
The text was updated successfully, but these errors were encountered: