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

Validate dependencies in non-isolated builds #557

Open
jaraco opened this issue Dec 28, 2022 · 2 comments
Open

Validate dependencies in non-isolated builds #557

jaraco opened this issue Dec 28, 2022 · 2 comments

Comments

@jaraco
Copy link
Member

jaraco commented Dec 28, 2022

Currently, if a non-isolated build is invoked, it simply attempts to invoke the build hook expecting the invoker to have supplied the dependencies. But if the environment doesn't have the dependencies and if the lack of dependencies doesn't create a failure in the build, the build proceeds without its declared dependencies (see jaraco/jaraco.packaging#9 (comment) for an example).

Better would be for build to enforce that the declared dependencies are met before invoking the build.

@henryiii
Copy link
Contributor

Build does do this. You have to pass both flags to skip the dependency check:

  --skip-dependency-check, -x
                        do not check that build dependencies are installed
  --no-isolation, -n    do not isolate the build in a virtual environment

Unlike pip, which makes the dependency check opt-in instead of opt-out.

There are actually a lot of places where you want to opt out (for example, if a CLI tool with an optional Python packaged version are listed as dependencies but actually fulfilled by the actual tool being present, like cmake and ninja). Another, possibly even more common and annoying is when the user pins things exactly inside the requirements, like setuptools or numpy, but you don't have control over the exact version (like when building in for package management, which usually only has a set version of things, like conda, pyodide, and linux distros) But build does default to validating.

@layday
Copy link
Member

layday commented Dec 30, 2022

Looking at the linked PR, I believe they are referring to the project_wheel_metadata function from utils which doesn't check dependencies.

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

No branches or pull requests

3 participants