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

chore: use dependency-groups #2064

Merged
merged 6 commits into from
Nov 19, 2024
Merged

Conversation

henryiii
Copy link
Contributor

Using dependency groups for cibuildwheel itself.

@henryiii henryiii force-pushed the henryiii/chore/usegroups branch from 113616f to 831a075 Compare October 30, 2024 19:24
.github/workflows/test.yml Outdated Show resolved Hide resolved
@henryiii
Copy link
Contributor Author

henryiii commented Nov 1, 2024

Cirrus: Failed to start an instance: FAILED_PRECONDITION: Monthly compute limit exceeded!

Trying to restart now that it's next month. Also, saw this:

Only ghcr.io/cirruslabs/macos-runner:sonoma is allowed. Automatically upgraded

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
requirements-dev.txt Outdated Show resolved Hide resolved
@henryiii henryiii marked this pull request as ready for review November 1, 2024 14:09
mayeut
mayeut previously requested changes Nov 2, 2024
Copy link
Member

@mayeut mayeut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require to wait for a new nox release as modifications are also needed in the noxfile that require non yet released features of nox.

@henryiii
Copy link
Contributor Author

henryiii commented Nov 3, 2024

Nox is just Python, and TOML support was added some time ago. So it's not required to wait for a nox release. I've updated the noxfile.

@mayeut mayeut dismissed their stale review November 5, 2024 07:01

outdated

@henryiii henryiii force-pushed the henryiii/chore/usegroups branch from f9d716f to defaa97 Compare November 14, 2024 17:00
@henryiii henryiii force-pushed the henryiii/chore/usegroups branch from defaa97 to 371426a Compare November 16, 2024 05:51
@henryiii
Copy link
Contributor Author

Okay to go in?

Copy link
Member

@mayeut mayeut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we wait for pip builtin support to keep workarounds to a minimum ?

.cirrus.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
Co-authored-by: Matthieu Darbois <[email protected]>
@henryiii
Copy link
Contributor Author

henryiii commented Nov 17, 2024

Using a tool to read the dependency groups doesn't seem too bad to me; pip won't support this until 25.1 at the earliest. But we can either put this in of the next release, or the 3.0 release, or wait, this doesn't affect end users, only developers.

@joerick
Copy link
Contributor

joerick commented Nov 18, 2024

Whats the proposed way to setup a dev environment with this? I still use pip install -e '.[dev]'. I'm not using uv habitually yet. Maybe the answer is uv, but it would be nice to have that documented somewhere. I know I can run tests with nox, but I still like to have a live venv I can point mypy/pyright to from my editor.

(I guess if we waited for pip to have support, that would take away this question)

@henryiii
Copy link
Contributor Author

henryiii commented Nov 18, 2024

uv doesn't support this via pip install * yet. The uv way to set this up would be to run uv sync. That will make a .venv environment that has an editable install of the project and the dev group in it, and vscode, etc. will find it automatically. Also all uv run commands will do this for you too. uv run cibuildwheel, for example, will set up a venv as needed, install dev dependencies as needed, and then run the requested command inside that venv. I've really liked using that everywhere, as it's fast, doesn't require setup, and doesn't require much if any config.

The non-uv way to do this is to pip/pipx install dependency-groups, then use that to generate the list of items you want to install. It also provides a pip wrapper that installs dependency groups, though I like dependency-groups --group dev | xargs pip install -e. better. uvx dependency-groups --group dev | xargs pip install -e. is a one liner if you have uv. Or pipx run dependency-groups --group dev | xargs pip install -e. is a one liner if you have pipx.

We can also export this, as I mentioned... somewhere, with dependency-groups --group dev > requirements-dev.txt.

Pip PR here: pypa/pip#13065

@joerick
Copy link
Contributor

joerick commented Nov 18, 2024

Thanks @henryiii, I've added that info into contributing.md.

Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this today, but I'm expecting the pip --group support to clean this up a bit!

@henryiii
Copy link
Contributor Author

Okay, waiting for @mayeut to update review, then.

@mayeut mayeut merged commit 8f21eb1 into pypa:main Nov 19, 2024
29 of 30 checks passed
@mayeut
Copy link
Member

mayeut commented Nov 19, 2024

Thanks @henryiii, all good now.

@mayeut
Copy link
Member

mayeut commented Nov 19, 2024

we missed the gitlab update which only runs on branches in the repo.

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 this pull request may close these issues.

3 participants