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

Question: why is --no-deps --no-build-isolation set? #582

Open
henryiii opened this issue Nov 16, 2024 · 13 comments · May be fixed by #584
Open

Question: why is --no-deps --no-build-isolation set? #582

henryiii opened this issue Nov 16, 2024 · 13 comments · May be fixed by #584

Comments

@henryiii
Copy link

henryiii commented Nov 16, 2024

Conda-build sets PIP_NO_BUILD_ISOLATION and PIP_NO_DEPENDENCIES (See https://github.com/conda/conda-build/blob/0ad4bb6829b440caae9ae8a4db14ab1ff3788ab7/conda_build/build.py#L3020). Why is it also being set in every recipe in

"<{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation"
? There are other flags set by conda-build, so this seem like an arbitrary set to re-specify on the command line.

I think both1 of these should be removed to allow conda-build to specify everything needed for pip to work and keep the recipes as simple as possible. Or all the other flags should be added too.

Notice in conda-forge/packaging-feedstock#32 where --no-build-isolation was being added to a recipe based on greyskull.

Footnotes

  1. Not completely sure PIP_NO_DEPENDENCIES is the same as --no-deps, as it seems to be it should be PIP_NO_DEPS. The translation is automatic, and there isn't a --no-dependencies flag. But I am sure that PIP_NO_BUILD_ISOLATION is correct. So at least that one could be trimmed here. Edit: tested and PIP_NO_DEPENDENCIES does work

@henryiii
Copy link
Author

FYI, I tested PIP_NO_DEPENDENCIES and it does work.

@matthewfeickert
Copy link

rattler-build does the same thing as conda-build

    // python variables
    // hard-code this because we never want pip's build isolation
    // https://github.com/conda/conda-build/pull/2972#discussion_r198290241
    //
    // Note that pip env "NO" variables are inverted logic.
    //    PIP_NO_BUILD_ISOLATION=False means don't use build isolation.
    insert!(vars, "PIP_NO_BUILD_ISOLATION", "False");
    // Some other env vars to have pip ignore dependencies. We supply them ourselves instead.
    insert!(vars, "PIP_NO_DEPENDENCIES", "True");
    insert!(vars, "PIP_IGNORE_INSTALLED", "True");

but their docs show using --no-deps --no-build-isolation as well. So cc @wolfv on if there is a reason I'm missing for having duplicated flags in the recipe files.

@wolfv
Copy link

wolfv commented Nov 16, 2024

Let's get rid of it! :) PRs always welcome

@matthewfeickert
Copy link

Let's get rid of it! :) PRs always welcome

Thanks @wolfv. This is useful to know that I'm not missing anything. I'll PR things next week!

@matthewfeickert
Copy link

So seems that we should revert grayskull's recommendation and also conda/conda-build#4960.

@wolfv
Copy link

wolfv commented Nov 17, 2024

I think the only thing that's confusing me right now is that the comment says that the NO env vars are inverted, but then we do:

# we want _NO_ build isolation
PIP_NO_BUILD_ISOLATION=False
# we want _NO_ dependencies from pip
PIP_NO_DEPENDENCIES=True

Although I am also quite sure that I copied this from conda-build and that it has been working fine :)

@wolfv
Copy link

wolfv commented Nov 17, 2024

Too bad they didn't go with more clear PIP_BUILD_ISOLATION={disabled, enabled} :)

@wolfv
Copy link

wolfv commented Nov 17, 2024

pypa/pip#5735

@henryiii
Copy link
Author

These are automatically generated from the command line flags. Every command line flag in pip has an environment variable version, but that’s why they’re not customized.

@ocefpaf
Copy link
Contributor

ocefpaf commented Nov 18, 2024

Conda-build sets PIP_NO_BUILD_ISOLATION and PIP_NO_DEPENDENCIES (See https://github.com/conda/conda-build/blob/0ad4bb6829b440caae9ae8a4db14ab1ff3788ab7/conda_build/build.py#L3020). Why is it also being set in every recipe in

We chose to be explicit in grayskull b/c conda-build has dropped those in the past in buggy releases and, those flags are not set in when using multiple outputs. I prefer to keep them explicit as they also inform users/recipe creators of what is happening under the hood.

@matthewfeickert
Copy link

I prefer to keep them explicit as they also inform users/recipe creators of what is happening under the hood.

This is fine, but just to give some context (copying from conda-forge/staged-recipes#28268 (comment) for findability by other people) I always assumed that the fact that grayskull had this recommendation of having --no-deps --no-build-isolation in the recipe meant that conda-forge wasn't using these flags anywhere as my assumption is that "If I have to specify something as the user then this means that it is my responsibility and that it isn't being dealt with elsewhere."

So I took away the opposite of the intended message.

@henryiii
Copy link
Author

Personally, I think I'd assume that I could remove these flags and then depend on build isolation working - which is very much not the case. I'm not fond of do-nothing flags that can be removed without any affect. And the flags are somewhat arbitrary; personally if I were to put one in it would be --no-build-isolation, I don't think --no-deps is any more important than, say, --ignored-installed, which is not included).

If it doesn't work in multiple outputs, that's a bit of an issue - is this all flags, or just some?

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