Hi! I have a github action that build wheels for several different architectures and python versions. Things appear to be working properly, except that my filenames all include cp36 as the python version despite being built with py 3.8 for example. You can see in the output below that I've requested cp38-macosx_x86_64 and the system python is 3.8, but the filename on the wheel is fast_numpy_loops-0.0.5-cp36-abi3-macosx_10_9_x86_64.whl
Output from cibuildwheel:
_ _ _ _ _ _ _
___|_| |_ _ _|_| |_| |_ _ _| |_ ___ ___| |
| _| | . | | | | | . | | | | | -_| -_| |
|___|_|___|___|_|_|___|_____|_|_|___|___|_|
cibuildwheel version 1.6.3
Build options:
platform: 'macos'
before_all: ''
before_build: None
before_test: None
build_selector: BuildSelector('cp38-macosx_x86_64' - '')
build_verbosity: 0
dependency_constraints: <cibuildwheel.util.DependencyConstraints object at 0x102f92e20>
environment: ParsedEnvironment([])
manylinux_images: None
output_dir: PosixPath('wheelhouse')
package_dir: PosixPath('.')
repair_command: 'delocate-listdeps {wheel} && delocate-wheel --require-archs x86_64 -w {dest_dir} {wheel}'
test_command: None
test_extras: ''
test_requires: []
Here we go!
+ Download https://www.python.org/ftp/python/3.8.4/python-3.8.4-macosx10.9.pkg to /tmp/Python.pkg
+ sudo installer -pkg /tmp/Python.pkg -target /
installer: Package name is Python
installer: Installing at base path /
installer: The install was successful.
+ sudo /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 /Users/runner/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/cibuildwheel/resources/install_certifi.py
WARNING: The directory '/Users/runner/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting certifi
Downloading certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Installing collected packages: certifi
Successfully installed certifi-2020.6.20
WARNING: You are using pip version 20.1.1; however, version 20.2.4 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install --upgrade pip' command.
-- pip install --upgrade certifi
-- removing any existing file or link
-- creating symlink to certifi certificate bundle
-- setting permissions
-- update complete
+ which python
/tmp/cibw_bin/python
+ python --version
Python 3.8.4
+ python /Users/runner/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/cibuildwheel/resources/get-pip.py -c /Users/runner/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/cibuildwheel/resources/constraints.txt
Collecting wheel==0.35.1
Downloading https://files.pythonhosted.org/packages/a7/00/3df031b3ecd5444d572141321537080b40c1c25e1caa3d86cdd12e5e919c/wheel-0.35.1-py2.py3-none-any.whl
Collecting pip==20.2.3
Downloading https://files.pythonhosted.org/packages/4e/5f/528232275f6509b1fff703c9280e58951a81abe24640905de621c9f81839/pip-20.2.3-py2.py3-none-any.whl (1.5MB)
Installing collected packages: wheel, pip
Found existing installation: pip 20.1.1
Uninstalling pip-20.1.1:
Successfully uninstalled pip-20.1.1
Successfully installed pip-20.2.3 wheel-0.35.1
+ which pip
/tmp/cibw_bin/pip
+ pip --version
pip 20.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
+ pip install --upgrade setuptools wheel delocate -c /Users/runner/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/cibuildwheel/resources/constraints.txt
Collecting delocate==0.8.2
Downloading delocate-0.8.2.tar.gz (91 kB)
Requirement already up-to-date: wheel==0.35.1 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from -c /Users/runner/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/cibuildwheel/resources/constraints.txt (line 13)) (0.35.1)
Collecting setuptools==50.3.0
Downloading setuptools-50.3.0-py3-none-any.whl (785 kB)
Building wheels for collected packages: delocate
Building wheel for delocate (setup.py): started
Building wheel for delocate (setup.py): finished with status 'done'
Created wheel for delocate: filename=delocate-0.8.2-py3-none-any.whl size=102755 sha256=ba2dfdd2eae579f6e9b165db5a5a083ff58b6c5bb129b7e3c12a1849fe6a9594
Stored in directory: /Users/runner/Library/Caches/pip/wheels/12/ba/45/c127e8c025000220b28d0c74fdbda1edfa28541edb0ad7f9fa
Successfully built delocate
Installing collected packages: delocate, setuptools
Attempting uninstall: setuptools
Found existing installation: setuptools 47.1.0
Uninstalling setuptools-47.1.0:
Successfully uninstalled setuptools-47.1.0
Successfully installed delocate-0.8.2 setuptools-50.3.0
WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available.
You should consider upgrading via the '/private/tmp/cibw_bin/python -m pip install --upgrade pip' command.
+ pip wheel /Users/runner/work/numpy-threading-extensions/numpy-threading-extensions -w /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibuildwheelgv_hmetx/built_wheel --no-deps
Processing /Users/runner/work/numpy-threading-extensions/numpy-threading-extensions
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Building wheels for collected packages: fast-numpy-loops
Building wheel for fast-numpy-loops (PEP 517): started
Building wheel for fast-numpy-loops (PEP 517): finished with status 'done'
Created wheel for fast-numpy-loops: filename=fast_numpy_loops-0.0.5-cp36-abi3-macosx_10_9_x86_64.whl size=141906 sha256=d6ca0f618d591f5bda344bee37a71620f78e8c09cbe6b8c07f470dd52fcac3e6
Stored in directory: /Users/runner/Library/Caches/pip/wheels/0b/5e/cc/04402e7b9cfcbd65db638c9f2910df869015b4826549f79f41
Successfully built fast-numpy-loops
WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available.
You should consider upgrading via the '/private/tmp/cibw_bin/python -m pip install --upgrade pip' command.
+ delocate-listdeps /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibuildwheelgv_hmetx/built_wheel/fast_numpy_loops-0.0.5-cp36-abi3-macosx_10_9_x86_64.whl && delocate-wheel --require-archs x86_64 -w /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibuildwheelgv_hmetx/repaired_wheel /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibuildwheelgv_hmetx/built_wheel/fast_numpy_loops-0.0.5-cp36-abi3-macosx_10_9_x86_64.whl
Github action run: https://github.com/Quansight/numpy-threading-extensions/runs/1316669448?check_suite_focus=true
Could you add CIBW_BEFORE_BUILD_MACOS="which pip;pip --version" to your pipeline?
Sure. I'm getting
+ which pip;pip --version
/tmp/cibw_bin/pip
pip 20.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
https://github.com/Quansight/numpy-threading-extensions/runs/1316828027?check_suite_focus=true
Hi @kcpevey ! Your setup.cfg has the limited API option
py-limited-api set to cp36, so when building using cp38 you'll get a cp36 compatible wheel (that wheel will work for any version of Python above 3.6).
We actually don't officially support py-limited-api with cibuildwheel, but as you've found, if you limit CIBW_BUILD sufficiently, it works fine :). Feel free to chime in at #78, it's something I keep meaning to implement!!
That makes sense. I think that may have been a remnant from the cookiecutter build. I didn't even realize that was coming into play! Thank you for finding that!
Most helpful comment
Hi @kcpevey ! Your setup.cfg has the limited API option
py-limited-apiset to cp36, so when building using cp38 you'll get a cp36 compatible wheel (that wheel will work for any version of Python above 3.6).We actually don't officially support py-limited-api with cibuildwheel, but as you've found, if you limit CIBW_BUILD sufficiently, it works fine :). Feel free to chime in at #78, it's something I keep meaning to implement!!