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

Compile build dependencies independently #174

Merged
merged 9 commits into from
Aug 13, 2024
Merged

Conversation

bruno-fs
Copy link
Owner

@bruno-fs bruno-fs commented Aug 8, 2024

pybuild-deps used to try to attempt to solve all build dependencies together, which was a design flaw and was causing issues.

Transitive dependencies aren't necessarily consistent. When pip is building packages it will build each in an isolated environment. Transitive dependencies won't be required for the prepared wheel.

With this PR this behavior is completely modified. Now build dependencies will be resolved independently. In order to avoid generating a longer list of dependencies, it will use the supplied requirements as optional constraints.

@bruno-fs bruno-fs force-pushed the independent-versions branch 10 times, most recently from 84b8aa0 to 5b65c60 Compare August 12, 2024 22:03
@bruno-fs bruno-fs changed the title Independent versions Compile build dependencies independently Aug 12, 2024
@bruno-fs bruno-fs force-pushed the independent-versions branch 2 times, most recently from 84fd44c to 6baafcb Compare August 13, 2024 13:13
@bruno-fs bruno-fs marked this pull request as ready for review August 13, 2024 13:17
Revisiting the code I had to remember year old decisions. Hopefully adding comments might help future contributors.
Also, dial coverage up to 100% again.
- use piptools key_from_ireq as the key for cache and uniqueness internal dicts
- move all the code handling the conversion of results from find_build_deps to ireq
  to a dedicated method
Found a bug with typeguard that's theoritically already solved
(agronholm/typeguardi#373). Maybe this is a edge-case. Not sure.

Given the current maintainer don't have time to dedicate to
the project (agronholm/typeguard#198), let's just remove these
checks. We can later add [pytest-beartype][pytest-beartype] as an alternative.

[pytest-beartype]: https://github.com/beartype/pytest-beartype
Copy link
Collaborator

@brunoapimentel brunoapimentel left a comment

Choose a reason for hiding this comment

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

I don't have a deep understanding of this project, but from what I can tell, this LGTM. Tested it with Cachi2 0.7.0, which previously failed with a build dependencies conflict, and now pybuild-deps is able to properly resolve it 🎉

@bruno-fs bruno-fs enabled auto-merge (rebase) August 13, 2024 20:46
@bruno-fs bruno-fs merged commit 374a88d into main Aug 13, 2024
12 checks passed
@bruno-fs bruno-fs deleted the independent-versions branch August 13, 2024 20:47
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