New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use of python_requires on editable package fails #5358
Comments
This fails because it tries to call export and export_sources as an editable package, when actually nothing requires to be exported. patch of client/graph/python_requires.py: index 2c20e6ec..3e64898a 100644
--- a/conans/client/graph/python_requires.py
+++ b/conans/client/graph/python_requires.py
@@ -60,8 +60,12 @@ class ConanPythonRequire(object):
python_require = self._look_for_require(conanfile.alias)
else:
package_layout = self._proxy._cache.package_layout(new_ref, conanfile.short_paths)
- exports_sources_folder = package_layout.export_sources()
- exports_folder = package_layout.export()
+ if hasattr(package_layout, 'editable_cpp_info'):
+ # Editable package does not require exporting
+ exports_sources_folder = exports_folder = None
+ else:
+ exports_sources_folder = package_layout.export_sources()
+ exports_folder = package_layout.export()
python_require = PythonRequire(new_ref, module, conanfile,
exports_folder, exports_sources_folder)
self._cached_requires[require] = python_require Would it be suitable ? |
Hi, I don't like that fix especially, we will take a look in case we have a better fix for this. |
Hi! IMO this is more a new feature than a bugfix (and not sure if it is a feature we can provide right now). TL;DR: a To implement this feature we would need the following changes:
But there is a huge problem in order to implement this behavior: to parse the layout file we need the settings and options, but the moment we require the Before trying to implement something, we need to triage again this issue, and I cannot think about a nice way to implement it:
Option (1) is not a solution, and option (2) would break the idea behind |
there has been progress in the python_requires, and we are proposing some changes to the way they are defined and used in: #5804 Some important difference:
def build(self):
sources = self.python_requires["tool"].path
file_h = os.path.join(sources, "file.h") There are tests in that PR that check that this way works both when python-requires are in the cache or they are editable (as long as the Doing this change was necessary to solve some major issues with python_requires. Now it will be possible to make python_requires to affect consumers packageIDs, thus forcing rebuilds, and they will play better with very important features like lockfiles. |
|
Environment
Description
When using a common dependency python_requires package as editable, the PackageEditbleLayout raise the following exception:
Reproduce
The following can be used for reproducing the error:
Packages:
Common package conanfile.py:
User package conanfile.py:
Reproduce the issue:
The text was updated successfully, but these errors were encountered: