Implement recipe_folder attribute - #7314
Conversation
|
Would be great :) |
|
The Another alternative would be to remove always this folder from every function and rely on the |
|
Hi, since I am working on a base class that will be used by python_requires, I would prefer having this patch integrated in the next version, as of today, I do a search for the wanted file in the current folder and its parent (most of the time the conanfile will be in the parent of the current folder), but that's not a long term solution. I will be describing my use case in another ticket to see if I am wrong somewhere |
|
I have a use-case for this: accessing the conanfile in a generator. The actual context is a bit complicated but I'll try to explain in detail (so that you can get a sense if this is a use-case that you want to support in conan): Our main project that consumes conan packages is Plex Media Server (PMS). The PMS build itself creates distro-agnostic tarballs that will be processed to create all kinds of packages: MSI installer for Windows, debian packages for debian etc. And since PMS itself is also used as a dependency in our clients, we also create a conan package from PMS at this stage. For that to work, we copy the conanfile at build time so it is present in these distro-agnostic tarballs. We are working on decoupling conan usage from PMS. Instead of using But this also means that we no longer have a conanfile in the PMS repository, but we want to keep packaging PMS as a conan package. So we need a way to copy the conanfile into the tarball contents. Right now, I'm copying the conanfile in the script that drives conan (i.e. it calls |
|
Hi. as recommended by #7316, I switched to use |
|
Hi again! I think that the use-vase that originated this PR is satisfied via @sztomi your use case is different as you want to access the |
|
Indeed the use case is covered by the conandata and I especially like the fact it is automatically exported. So I do not need this feature anymore, but it would be great to still have this ability, on the principle. If it does not have unwanted side effects, of course. In short, that's ok for me if this feature does not land in conan, for the moment |
|
This issue reported here: #7355 would not be good enough with |
|
I think it is totally fine to add this We only need to document which path it is (it is always the place where we read the recipe from, right?), we need to check that it is the same folder as the |
|
This feature is also requested (or at least would be very convenient) here: #7268 |
Changelog: Feature: Define
recipe_folderattribute pointing to the folder containingconanfile.pyDocs: conan-io/docs#1785
Close #7312
Close #7315
Would help with:
@jgsogo the most important point of this PR is if we really want to allow this, or what Pandora box this could open, and allow too crazy things.