Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature/new py requires #5804
Changelog: Feature: New
Intended to recover control from current python_requires, which resolution is executed by interpreter.
Things to take into account:
Needs to address: #5861
Will probably close #6034 (need to add tests)
jgsogo left a comment
I understand the need of taking control over the
I like to have the
I don't like the
It is not possible now either, as they are evaluated much sooner than the settings or options are there. This doesn't change.
We need a syntax to access them from within the recipe, any other suggestion? It is ok about
No longer needed. The nice and clean way to have it is:
class SomeClass(object): .... class Pkg(ConanFile): ....
class Recipe(ConanFile): python_requires = "tool/..." python_requires_extend = "tool.SomeClass"
I think it reads much nicer than a wrapper method.
Sure, can be added, it shouldnt be a problem for lockfiles, I will add the test.
As said before, it is not possible to delay that far the evaluation of python_requires, specially if we want to extend the class from them, we need them much before having settings and options defined. Furthermore, it has not been requested, I'd vote to keep this one as simple as possible.
Feel free to suggest real alternatives, but please take into account that most of this effort is to reduce complexity on our side, yes, even at the expense of a not very pythonic approach. The code to inject the base class is around 4-5 lines, please try to keep the alternatives simple.
Thanks for the review!
lasote left a comment
Remember the docs. Mentioning no exports_sources anymore and the alternatives. Also any corner case of things that cannot/shouldn't be inherited etc. I would say it shouldn't break anything from the old approach, so we should release it and receive issues.