conan-package-tools
conan-package-tools copied to clipboard
delaying load of recipe until it is required by builders
Changelog: Bugfix: Fixes #331
- [x] Refer to the issue that supports this Pull Request.
- [x] I've read the Contributing guide.
- [x] I've followed the PEP8 style guides for Python code.
I haven't touched any tests yet, just wanted to check if this is a direction that could be pursued. The basic idea is to replace code that potentially loads the recipe with code that creates objects that lazily load the recipe. As a result, the recipe isn't loaded until its attributes are required by builders, which happens after all remotes have been already added (at least in theory).
The idea sounds good, delaying the recipe seems be the best approach to solve python requires in CPT. Thanks for your contribution! WDYT @lasote ?
Sounds complex and error prone to be honest.
Alternatively, we could just add necessary remotes in constructor.
Would be worth it to try it, yes.
That is what I originally wanted to do, but then I thought, that there is a reason why adding remotes wasn't put into constructor but into run method in the first place.