feat: warn about R dependencies missing from conda-forge in generated recipes - #2622
feat: warn about R dependencies missing from conda-forge in generated recipes#2622pb01ka wants to merge 3 commits into
Conversation
Yes, but not by default. |
|
Noted. Will update this PR tomorrow using my best judgement. |
Addressed using my best possible judgement. I have added a Question: should Now that both flags exist side by side, I want to sanity-check the design. At a high level
Given how close they are on the surface, would you prefer we:
I'm happy either way; just want to avoid shipping two options that most users will find hard to tell apart (including me 😆). |
I dont see this option in grayskull or conda-skeleton, only
I think this makes most sense, having generated recipes for already available packages doesn't seem useful (especially given that boilerplate recipes may need further changes to be valid) |
|
@jsmolic I used my best possible judgement to implement your suggestion,
The PR description is also updated to reflect the same. TY. Please let me know if anything else needs to be done. |
|
@wolfv Kindly take a look. This PR is passing the tests and waiting for reviews/decision. TY. |
| /// Unlike PyPI, CRAN package names map to conda-forge by a fixed convention | ||
| /// (`foo` -> `r-foo`, see [`format_r_package`]), so no name-mapping lookup is | ||
| /// needed here, only an existence check via the anaconda.org API. | ||
| async fn conda_forge_package_exists(conda_name: &str) -> bool { |
There was a problem hiding this comment.
I think we should use the Repodata Gateway here and query conda-forge that way. Is it possible for you to try that?
There was a problem hiding this comment.
I implemented the repodata gateway approach using my best judgement. Please take a look and let me know your feedback. TY.
|
Looks good except that one comment! |
|
@wolfv I addressed your comment to the best of my abilities and understanding. The tests are also passing. Please take a look. TY. |
Refer #2563
generate-recipe cran --treenow recurses only into dependencies missing from conda-forge by default, instead of the whole dependency tree. Pass the new--fullflag alongside--treeto restore the old behavior.Summary
cran.rsalready collected an R package's dependencies into aremaining_depsset while generating a recipe, but the set was discarded after use - there was no signal to the user about which of those dependencies weren't yet packaged on conda-forge. The recipe would only fail much later, at solve time, with no clear diagnostic pointing back to the missing R package.This PR checks each collected dependency against conda-forge right after the recipe is generated, and logs a warning for any that are missing. The check goes through
rattler_repodata_gateway'sGateway, with every dependency batched into a single query rather than one request per package. This mirrors the existing behavior discussed forpypi.rs, minus the name-mapping step: CRAN packagefooalways maps to conda-forger-fooby convention, so no lookup table is needed.Important Points
warn_about_missing_conda_forge_depsintogenerate_r_recipe, run once per generated recipe..invalidTLD, which is guaranteed never to resolve).--tree's behavior: it now recurses only into dependencies missing from conda-forge by default (matching grayskull's--recursive), instead of blindly recursing into the whole dependency tree. (refer feat: warn about R dependencies missing from conda-forge in generated recipes #2622 (comment)) Generating boilerplate recipes for packages already available on conda-forge isn't useful, since they'd need further changes to be valid anyway.--full/-fmodifier to restore the old behavior when it's genuinely wanted (e.g. building a self-contained "forge" channel that doesn't want to depend on conda-forge for anything in the tree):--tree --fullrecurses into every dependency regardless of conda-forge status. Has no effect without--tree.--recursiveflag alongside the untouched--tree, but feat: warn about R dependencies missing from conda-forge in generated recipes #2622 (comment) and feat: warn about R dependencies missing from conda-forge in generated recipes #2622 (comment) pointed out the two were confusingly similar at a glance, so--recursivewas folded into--tree(with--fullas the escape hatch) instead of shipping both.