Skip to content
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

Caping dependecies for testing (issue with numpy 1.22 on ubuntu i686) #993

Closed
MuellerSeb opened this issue Jan 15, 2022 · 6 comments
Closed

Comments

@MuellerSeb
Copy link
Contributor

MuellerSeb commented Jan 15, 2022

Description

We had a strange issue, where our CI job for ubuntu i686 hanged for hours before it got canceled (link)
Nothing was changed on our side. The same workflow was working one month earlier (link)

This happend for py38, where I noticed (after hours of wondering), that for numpy 1.22, a zip file was downloaded and a wheel was built (before numpy 1.21.4 was downloaded with a prebuilt wheel). It seem that the built wheel for numpy 1.22 was broken, so the test suite did not start.

Numpy apparently dropped building wheels for 32bit on linux with v1.22. So I wanted to cap the numpy version for ubuntu32bit.

I got it running with this override in pyproject.toml:

[[tool.cibuildwheel.overrides]]
select = "*manylinux_i686"
# no wheels for 32 bit anymore
test-requires = "numpy<1.22"

Problem is just, that first numpy 1.22 is built and then downgraded before the test suite (which then succeeds).
So it would be best, to first install the test-requires and then install the package to be tested.

I guess I could just use before-test = "pip install 'numpy<1.22'" to install numpy beforehand, but I think test-requires describes the situation better.

Did I miss an obvious option for this situation?

Thanks for the great package,
Sebastian

Build log

No response

CI config

https://github.com/GeoStat-Framework/GSTools/blob/d8941c2fc76531304e59faf75d36fd95153c38d3/.github/workflows/main.yml

@MuellerSeb
Copy link
Contributor Author

I guess my main question is: What speaks against installing test-requires before installing the wheel built by CIBW?

@henryiii
Copy link
Contributor

Capping is not a good solution. You'll more than likely forget the cap here. A better solution is to add:

[tool.cibuildwheel.environment]
# this makes sure that we build only on platforms that have a corresponding numpy wheel
PIP_ONLY_BINARY = ":all:"

Or set it to "numpy" only (comma separated list).

@henryiii
Copy link
Contributor

There's a prefer binary option too.

@MuellerSeb
Copy link
Contributor Author

Thanks for the answer. What happens with packages that only have a source distribution?

@henryiii
Copy link
Contributor

The require variant produces an error, the prefer variant installs it anyway. Though for the require version you can lost packages instead of :all:.

I usually use require on NumPy then skip tests for the platforms it is missing wheels for, guessing users on those platforms will use their system package manager for NumPy. Some people just skip those platforms entirely.

@MuellerSeb
Copy link
Contributor Author

I went with:

environment = "PIP_PREFER_BINARY=1"

in pyproject.toml. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants