Comments (5)
So I confirmed that the env vars set by that param are injected into the test stage, including provisioning the deps: https://github.com/pypa/cibuildwheel/blob/77c57bd/cibuildwheel/windows.py#L549.
Using
before-test = [
"unset PIP_CONSTRAINT", # https://github.com/pypa/cibuildwheel/issues/1666
]
doesn't work on windows. Still trying to find proper syntax for using a windows-specific command...
from cibuildwheel.
Yes, I understand the confusion. Unfortunately the project grew in such a way that tests were added as part of the 'build' phase, as config options like CIBW_BUILD choose which pythons to build-and-test. Additionally there is no way to just test a wheel without building it first, so the confusion never really came up. Maybe there's some clarification we can do to the environment option though.
As for your specific question, it does suggest the need for an additional CIBW_TEST_ENVIRONMENT option. However, I notice that you are setting PIP_CONSTRAINT. That is actually an option that cibuildwheel sets itself to ensure determinism in the build env that build
creates. So it might actually not be having an effect. Is your intention to pin your build backend dependencies? We might have to look at creating a feature for that.
from cibuildwheel.
Yep. Your assessment is correct. We used to run the cythonize
program before invoking any Python packaging. That way, we were in control of this specific build dep. Now that I moved that into an in-tree build backend, that control is kinda lost and the current standard way of regaining it is setting the PIP_CONSTRAINT
env var, since the CLI flags don't reach the ephemeral PEP 517 build env.
As for setting your own var, I think it's fine for your deps, but might be an undesired side effect for the end-users. Especially, when undocumented... I'd suggest scoping it more carefully.
from cibuildwheel.
So I finally came up with a hack to bridge the gap for us — I injected an early PIP_CONSTRAINT= pip install PyYAML
command that ends up building a wheel from sdist with a Cython version matching what PyYAML declares. Pip caches that wheel and any further attempts to install it, just pick it up from cache:
https://github.com/aio-libs/yarl/blob/c907c8e/pyproject.toml#L69-L77
I've made an exclusion for Windows since it always picks up wheels as historically, win32 and win64 wheels have been published by PyYAML, unlike *nix:
https://github.com/aio-libs/yarl/blob/c907c8e/pyproject.toml#L87
I hope to drop this workaround as soon as cibuildwheel starts providing an adequate replacement...
from cibuildwheel.
A clever hack! I did add a +1 to the pypa/build
features request for an alternative to PIP_CONSTRAINTS, as I'd like to expose an option for build-dep pinning through CIBW_BUILD_FRONTEND
. pypa/build#292 (comment)
In the meantime, it remains an open question over the need for more specific build/test env var options.
On the one hand, the reason this is needed is that PIP_CONSTRAINTS affects the inner workings of both build
and cibuildwheel
, and that's the source of the issue. If build
can support a constraint option, we avoid extra complexity and more options here.
On the other hand, practicality beats purity. Comments/opinions welcome.
from cibuildwheel.
Related Issues (20)
- Problem loading Apple Silicon wheels built on Intel Mac runner: `(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')` HOT 5
- Allow overriding of docker volume argument HOT 6
- env variables are not taken over into manylinux docker container HOT 2
- Cannot find or install `meson-python` to build fortran sources HOT 4
- Dependencies are not properly built into the whl files in Python3.6 HOT 2
- Unable to find image 'musllinux_1_2:latest' locally HOT 2
- `package-dir` input of the GitHub Action shouldn't imply building only from a Git checkout
- [FR] Expose `{package}` placeholder to the build stage HOT 5
- `can't find rust compiler` when building with Github CI and ubuntu-latest HOT 5
- Misleading documentation for `CIBW_BEFORE_ALL` HOT 6
- [docs][infra] Set up a pypa.io subdomain? HOT 10
- [CI] Check dists in strict mode HOT 1
- [CI] Use pre-built sdists for testing @ GHA rather than testing a Git checkout
- "symbol not found" in MacOS arm64 wheels for C-extension dependent on NumPy HOT 2
- Sporadic timeouts in oci_container.py HOT 1
- Troubleshooting Python 3.12 uWSGI wheel HOT 16
- Note about `actions/upload-artifact@v4` HOT 25
- Feature Request: flag to skip build if there is not a numpy wheel available HOT 2
- Access environment variables in config-settings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cibuildwheel.