docs
docs copied to clipboard
[bug] Why are some methods documentation not at the top level? (and other oddities)
Steps to reproduce (Include if Applicable)
This might be my relative ignorance of python, but sometimes i'm looking at self.copy and I say "ok those are methods of ConanFile...let me look at the handy conanfile.py Methods reference (which is also weird...why isn't it the documentation for the python class ConanFile?)...but i digress. Instead I need to zoom around and find that it's under the package method. Why not at the top level with package cross referencing it? Similarly with self.run. Again maybe i'm missing something but i've run into this multiple times. Maybe self.copy is somehow dynamically added within package? In that case i guess it would still be nice to show 'copy' as a sub-bullet of 'package' or something since that is maybe a more foreign concept at least to C++ developers.
Hi @rconde01
Indeed, the self.copy is injected for the package() method, but will not exist in other recipe methods.
We are structuring better the things that can be used in recipes. It is possible that self.copy() could be a FileCopier() tool, so this could be more explicit.
It is true that even self.copy() is described in package(): https://docs.conan.io/en/latest/reference/conanfile/methods.html#package, it is not directly evident as an item. I am moving this issue to the docs repo, in case it can be improved there (but in any case, probably the best solution is to make it explicit)
another point here is that copy is available from other methods (e.g. imports)
another point here is that copy is available from other methods (e.g. imports)
Exactly. In fact, the important point is that the copy from the import() is a different one! That has a different behavior, of course, and some different parameters. But that is not evident, that would be another reason to make them explicit, so it is less confusing.