Comments (5)
(Not disagreeing with better docs, btw)
from cibuildwheel.
Agreed on the docs. It's one of those things that was implied and never said.
from cibuildwheel.
This is just subprocess.run
with shell=True
. Python respects the $SHELL
environment variable on Posix. Generally, this is whatever you are running on macOS. On Linux, since it runs in the manylinux docker container, you'll have bash. Not sure if it's always cmd on Windows or if it respects what you run it from.
In general, it's probably best to keep this simple and cross-platform, and then manually run a bash/bat/whatever script with complex commands if you need them. Or a Python script. :)
from cibuildwheel.
Yeah, I had a hunch it would just be calling subprocess.run
. I guess for me, it just wasn't clear and other than trial and error, it was difficult to figure out.
I think there's a few things that could help here:
- Improving the docs to make what you explained really clear.
- Perhaps adding some clearer diagnostics in the CI logs that show which shell interpreter is being used.
Ultimately, it would be awesome to be able to specify the interpreter to allow something like:
before-build = {
shell = "python",
script = 'import shutil; shutil.rm("{package}/bin")'
}
Though I'm not sure if there's a desire for that, and it might complicate things significantly.
from cibuildwheel.
You can do that today. Use
before-build = [
"""python -c 'import shutil; shutil.rm("{package}/bin")'""",
]
Same for bash, etc. Better yet, stick the contents in a file, stick #!/usr/bin/env python
(or bash, etc) at the top, make it executable, then run the file, like
before-build = [
"./tools/remove_bin.py",
]
These are all cross platform and donβt depend on the shell Python uses.
Also, your example was invalid TOML (though it will be valid in TOML 1.1 eventually). Inline tables must be one line in 1.0. :(
from cibuildwheel.
Related Issues (20)
- @v2 doesn't exist HOT 3
- Unify the shells we use for before-build, test-command etc? HOT 5
- tar: Error opening archive: Unrecognized archive format when copying wheels to host HOT 2
- How can I pass arguments into setup.py? HOT 2
- MacOS wheels are not actually universal2 builds HOT 15
- swapcontext: symbol not found when testing wheel in musllinux, but compilation complete HOT 1
- How to produce Python3.12 packages in different platforms HOT 2
- Override merge of dictionary: merge by dict keys?
- Macos wheel generated/tagged for wrong macos version HOT 4
- cibuildwheel incorrectly naming wheel to linux_x86_64 after scikit_build_core 0.9 release HOT 5
- [small] In release 2.18 documentation, freethreaded section seems to contain wrong #-link HOT 1
- delocate.libsana.DelocationError: Failed to find any binary with the required architecture: 'arm64' HOT 5
- conda package HOT 3
- [feat] uv support HOT 4
- ModuleNotFoundError: No module named 'Cython' HOT 13
- `cibuildwheel` not finding the `conan` executable HOT 4
- Feature request: retry after pip error due to network issue
- extra emtpy `package.libs` directory included in wheel HOT 1
- Question: Universal2 wheel with binary extension
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.