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

Is pkgconfig really a runtime dependency? #295

Open
hmaarrfk opened this issue Dec 30, 2021 · 6 comments
Open

Is pkgconfig really a runtime dependency? #295

hmaarrfk opened this issue Dec 30, 2021 · 6 comments

Comments

@hmaarrfk
Copy link

It seems strange that pkgconfig is listed as a runtime dependency in
https://github.com/libvips/pyvips/blob/master/setup.py#L85

When it is only used in pyvips_build

https://github.com/libvips/pyvips/blob/master/pyvips/pyvips_build.py#L3

Is it really required during standard runtime?

If not, could we remove it from the install_requires section?

I'm sure there is some edge usecase I'm forgetting here..

The reason I am interested in this is that some users seem to like to use pip check to ensure their installs are consistent, so I would like to avoid the install of an unnecessary package.

@jcupitt
Copy link
Member

jcupitt commented Dec 30, 2021

Hi @hmaarrfk,

From memory, pkg-config is needed when setup.py runs (to pick API or ABI mode for cffi), and again a second time during the install itself, though only if API mode has been previously selected, when the extension is generated and built.

I expect there's a better way of expressing this. Any suggestions would be very welcome.

@hmaarrfk
Copy link
Author

hmm, thanks.

I don't actually know how cffi works to be honest. We currently have trouble with the conda-forge build where osx-arm is cross compiled and the CFFI build process is troublesome.

@hmaarrfk
Copy link
Author

Given that it isn't actually used in the runtime, only during compilation, I think it should be safe to remove pkgconfig as a runtime dependency. I'll see if I can submit a patch with the associated testing changes.

@hmaarrfk
Copy link
Author

Hmm. It isn't so clear to me that there are tests for both API / ABI mode. I'm a little worried about removing things when I 'm not supposed to.

@jcupitt
Copy link
Member

jcupitt commented Dec 30, 2021

I get very confused by the names of the python packaging and install phases. There's dist, sdist, wheel, setuptools, distutils, wheels can include platform-specific components but still be source based, etc. And each one seems to have different names for the various stages.

Anyway, pyvips tries to install in API mode, and falls back to ABI if that fails. And even the most specific type of pyvips binary install can still need pkg-config, since the binary does not include the libvips headers or binary, which might or might not be present on the target.

@kleisauke
Copy link
Member

kleisauke commented Jan 8, 2024

PR #445 would fix this. It depends on pkgconfig only in build-system.requires.

"pkgconfig>=1.5",

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

3 participants