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

Support for PEP 735 dependency groups as test requirements ? #2057

Closed
neutrinoceros opened this issue Oct 26, 2024 · 8 comments · Fixed by #2063
Closed

Support for PEP 735 dependency groups as test requirements ? #2057

neutrinoceros opened this issue Oct 26, 2024 · 8 comments · Fixed by #2063

Comments

@neutrinoceros
Copy link

Description

Now that PEP 735 is officially accepted, I wonder if it would be possible to add support for a CIBW_TEST_GROUPS/test-group option (mirroring CIBW_TEST_EXTRAS/test-extras) ?
I've been trying to migrate a project from using requirement files to dependency groups after uv added support for it, but so far I haven't managed to migrate my cibuildwheel configuration to use that, but it feels like it could maybe be natively supported.

Build log

No response

CI config

No response

@joerick
Copy link
Contributor

joerick commented Oct 27, 2024

This was mentioned briefly on the discord-

henry.iii (@henryiii)
Would it make sense to support dependency groups in cibuildwheel, just like we support extras now?

joerick
yeah, i think so, but i think we'd want to wait until pip support it pypa/pip#12963
i guess it does somewhat depend if pip end up reusing the extras-style syntax for them. Then they'd just work through the existing CIBW_TEST_EXTRAS option. But, that seems a bit unlikely to me

henry.iii (@henryiii)
I think it's completely valid to have both [test] and a test dependency group. And dependency groups won't require installing the package. So it's very likely to be some new flag, I think.
I think uv is calling it --groups
And yes, nothing supports them yet. But I'd assume uv will very, very soon, and pip in the future, so worth starting to think about it.

It looks like pip is heading towards an option --group, so CIBW_TEST_GROUPS/test-groups with a list argument makes sense to me. But we'll need support in pip before we can start work on this.

@henryiii
Copy link
Contributor

henryiii commented Oct 27, 2024

There’s no need to wait for support in pip, it’s fine and probably easier just to read it ourselves of use the PyPI package, we already have the pyproject.toml, and we support multiple installers (pip and uv). Tox, uv, and validate-pyproject have all shipped support. Nox can just support it via Python for now, though looking into a nicer option.

There’s a small chance pip might not support it, at least for a while, since it currently has no idea of a “project” and this is a project command if not combined with an install.

@joerick
Copy link
Contributor

joerick commented Oct 27, 2024

There’s a small chance pip might not support it, at least for a while, since it currently has no idea of a “project” and this is a project command if not combined with an install.

Ohhh that's the stumbling block? Okay interesting. Well I suppose we could read them out of pyproject.toml, if that pip support is gonna take a while.

@henryiii
Copy link
Contributor

@sirosen's dependency-groups would provide this for us, but it only supports 3.9+ (and there's no older version for 3.8). So if we want it in the next release, we'll have to implement it by hand, but it isn't too hard, I've done it in wntrblm/nox#876. Or we could wait till we drop 3.8-3.10 for cibuildwheel 3.

@sirosen
Copy link

sirosen commented Oct 28, 2024

Per the conversation over on nox, I've just added 3.8 support to dependency-groups v1.1.0 .
It was a total oversight of mine that I had started at 3.9+ .

@henryiii
Copy link
Contributor

Is the PEP getting a page on https://packaging.python.org/en/latest/specifications/?*

@sirosen
Copy link

sirosen commented Oct 29, 2024

I have a PR up but it's only been a day, so it hasn't gotten review yet.
But yes, it will get a page there, ideally a bit easier to read than the full PEP, and there will be the typical blurb to link from the PEP to the official spec page.

(Comments on the proposed doc welcome, BTW, if anything seems ambiguous or suboptimal there.)

@neutrinoceros
Copy link
Author

thanks all for tackling this so quickly !

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

Successfully merging a pull request may close this issue.

4 participants