conan-package-tools icon indicating copy to clipboard operation
conan-package-tools copied to clipboard

delaying load of recipe until it is required by builders

Open grisumbras opened this issue 6 years ago • 7 comments

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.

grisumbras avatar Mar 21 '19 07:03 grisumbras

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 21 '19 07:03 CLAassistant

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).

grisumbras avatar Mar 21 '19 07:03 grisumbras

The idea sounds good, delaying the recipe seems be the best approach to solve python requires in CPT. Thanks for your contribution! WDYT @lasote ?

uilianries avatar Mar 21 '19 11:03 uilianries

Sounds complex and error prone to be honest.

lasote avatar Mar 25 '19 07:03 lasote

Alternatively, we could just add necessary remotes in constructor.

grisumbras avatar Mar 25 '19 07:03 grisumbras

Would be worth it to try it, yes.

lasote avatar Mar 25 '19 07:03 lasote

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.

grisumbras avatar Mar 25 '19 10:03 grisumbras