regro / cf-scripts

Flagship repo for cf-regro-autotick-bot
Other
48 stars 72 forks source link

Add `setuptools` and/or `wheel` to `requirements/host` when used #2888

Open jakirkham opened 1 month ago

jakirkham commented 1 month ago

In preparation for changes in pip's packaging as discussed in issue ( https://github.com/conda-forge/pip-feedstock/issues/124 ), it would be good if we could detect the usage of setuptools and/or wheel in Python packages and add them to requirements/host if they are needed

jakirkham commented 1 month ago

cc @beckermr

beckermr commented 1 month ago

yes we can add a mini-migrator but we'll need to figure out a decent way to understand what we need to add - it is not clear to me when we need setuptools-only vs both setuptools+wheel.

jakirkham commented 1 month ago

To the extent that Python packages declare these dependencies in their pyproject.toml's build-system.requires, grayskull can pick them up and add them

Is this something that depfinder checks?

beckermr commented 1 month ago

depfinder only detects imports and so would miss this in some cases.

jakirkham commented 1 month ago

Can you please share some examples? Identifying the edge cases will help us come up with a better solution

beckermr commented 1 month ago

Oh right sorry. Here are the ones I am thinking of. None of them mean we cannot do this, but it will require thought+code.

jakirkham commented 1 month ago

As an interesting example

lda gets flagged as needing setuptools: https://github.com/conda-forge/lda-feedstock/pull/12

AFAICT it is only used in lda's cibuildwheels tests

beckermr commented 1 month ago

Even more interestingly, setuptools is already in host in that recipe. :/

beckermr commented 1 month ago

Ahhhh. The bot flagging that is not related to depfinder or grayskull but is because it detected that package in host.