-
Notifications
You must be signed in to change notification settings - Fork 249
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
Ignore missing setup.py
until BEFORE_BUILD is run
#1139
Comments
There is only `setup.py.in` template pypa/cibuildwheel#1139
We could see if it's movable, but couldn't you add a I think it's advantageous to quit quickly if cibuildwheel is misconfigured, so if the above suggestion works, that might be best. |
@henryiii CMake recommends doing out of tree builds, which means it generates all files for the build in a new directory, including I am not sure it is possible to replace the dynamic parts of version="@PACKAGE_VERSION@",
...
ext_modules = cythonize(Extension(
"opendht",
["@CURRENT_SOURCE_DIR@/opendht.pyx"],
include_dirs = ['@PROJECT_SOURCE_DIR@/include'],
language="c++",
extra_compile_args=["-std=c++17"],
extra_link_args=["-std=c++17"],
libraries=["opendht"],
library_dirs = ['@CURRENT_BINARY_DIR@', '@PROJECT_BINARY_DIR@']
)) |
Having an |
You wouldn't replace anything in [build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta" Every package should have that. It defines the base build system. No changes needed to setup.py. I'd recommend something like scikit-build where you talk to CMake from an existing setup.py, rather than inject it like this. (Pybind11 examples https://github.com/pybind/scikit_build_example and by-hand https://github.com/pybind/cmake_example) Your structure will not work from source directly - you'd have to do some hacks to make a working SDist. If you are generating valid SDists, maybe use the SDist with cibuildwheel instead? Also, why are you using |
I think it's fair to require a hack for cibuildwheel if you require a hack to build with |
Actually, you can improve your build too! # python/pyproject.toml
[build-system]
requires = ["setuptools>=42", "cython", "cmake"]
build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
before-all = "cmake ." Now you need no configuration in your CI file, and you can run it locally, and it might even work on macOS or Windows. (This is using your same in-tree build in the current source. If you wanted to do out-of-tree, you'd put the pyproject.toml in the build dir, and then point cmake back at the source dir.) |
I can't answer this, because is the project of mine. Just trying to use it, but I guess it is historical abitrolly/opendht@42ba16d and it from seven years ago. |
Agreed. |
So how to provide |
What’s wrong with the one I show above? This one: # python/pyproject.toml
[build-system]
requires = ["setuptools>=42", "cython", "cmake"]
build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
before-all = "cmake ." |
A few problems.
|
It's not supposed to "replace it". pyproject.toml tells your builder (pip or build) how to make your wheel. It tells you what is required - for you, that's Cython, CMake, and setuptools. That's why you are having to manually install a Python package (Cython) from your distro package manager! You currently can't control CMake or Cython version!
All well behaved Python packages should have a
A very useful layer that lets you run cibuldwheel locally or on any other CI system too! Only
Rewrite if needed, but I think this is in the right place and does run at cibuldwheel root, not project root. All your config for cibuldwheel except build should go here, then you can run locally for testing as long as you have docker. |
I don't see how that is going to work.
I don't see how that 's possible to do this in |
I've done it in abitrolly/opendht#2 |
There is only `setup.py.in` template pypa/cibuildwheel#1139
Description
In https://github.com/savoirfairelinux/opendht/tree/master/python
setup.py
is generated fromsetup.py.in
after the build is run. Butcibuildwheel
fails too early, without runninCIBW_BEFORE_ALL
andCIBW_BEFORE_BUILD
commands.Build log
https://github.com/abitrolly/opendht/runs/6872632272?check_suite_focus=true
CI config
https://github.com/abitrolly/opendht/actions/runs/2492318864/workflow
The text was updated successfully, but these errors were encountered: