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

pip --global-option #9981

Open
bdols opened this issue Dec 17, 2024 · 3 comments
Open

pip --global-option #9981

bdols opened this issue Dec 17, 2024 · 3 comments
Labels
question Asking for clarification or support

Comments

@bdols
Copy link

bdols commented Dec 17, 2024

is it possible to supply "global-options" to the build step?

I'm looking at a project that is doing the following:
CC="cc -mavx2" pip install pillow-simd==9.0.0.post3 --global-option="build_ext" --global-option="--enable-zlib" --global-option="--enable-jpeg" --global-option="--enable-tiff"

If I "uv add pillow-simd==9.0.0.post3", I can see the _imaging.so doesn't contain the jpeg symbols

@zanieb
Copy link
Member

zanieb commented Dec 17, 2024

That option is setuptools specific and is being deprecated, see

I think the idea is to use --config-settings instead? But honestly I'm confused about the state of setuptools behaviors... e.g

@bdols
Copy link
Author

bdols commented Dec 18, 2024

with setuptools 75.6.0, I'm able to, at least, pass these options, like so:
CC="cc -mavx2" uv add -vv -n pillow-simd==9.0.0.post3 -C--build-option="build_ext" -C--build-option="--enable-webp" -C--build-option="--enable-webpmux" -C--build-option="--enable-jpeg2000" -C--build-option="--enable-zlib" -C--build-option="--enable-jpeg"
I verified by adding -C--build-option="--enable-tiff" and the build failed because it couldn't find libtiff.

but how do I declare these options in the toml config?

@Xiddoc
Copy link

Xiddoc commented Dec 18, 2024

I just finished wrestling uv for a few hours on a similar problem. I was trying to download and build the latest development version of mypy, then building it using the setup.py file (compiles it with mypyc, making it much faster).

The actual shell command I essentially wanted to run was:

python setup.py bdist_wheel --use-mypyc

And I found that the following pyproject.toml settings do just that:

[tool.uv]
config-settings = { --build-option = "--use-mypyc" }

Hopefully this is actually the solution to the problem, and that I didn't just get lucky with my build 😅

@zanieb zanieb added the question Asking for clarification or support label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

3 participants