Trying to update the metadata, it fails because the PackageEditableLayout has no update_metadata(). The main questions are:
PackageCacheLayout sometimes, e.g from the remote_registry.py?Traceback (most recent call last):
File "/home/luism/workspace/conan_sources/conans/client/command.py", line 1832, in run
method(args[0][1:])
File "/home/luism/workspace/conan_sources/conans/client/command.py", line 1423, in remote
return self._conan.remote_remove(remote_name)
File "/home/luism/workspace/conan_sources/conans/client/conan_api.py", line 77, in wrapper
return f(*args, **kwargs)
File "/home/luism/workspace/conan_sources/conans/client/conan_api.py", line 922, in remote_remove
return self._cache.registry.remove(remote_name)
File "/home/luism/workspace/conan_sources/conans/client/cache/remote_registry.py", line 301, in remove
with self._cache.package_layout(ref).update_metadata() as metadata:
AttributeError: 'PackageEditableLayout' object has no attribute 'update_metadata'
@memsharded I would like to know what do you think about this.
I think that so far it doesn't make sense, as metadata are revisions (we don't have them while editable) and remote (same). If the package is in editable mode, I think doesn't make much sense to return PackageCacheLayout for it, so far the PacakgeEditableLayout have placeholder methods to provide better error messages.
Agree. But then what, how to solve this issue? Should the remote remove just ignore the editable layouts? When the package is no longer in "editable mode" it will have metadata with a wrong remote (removed).
I see, you are right.
I think there are 2 approaches:
with self._cache.package_layout(ref, from-cache=True).update_metadata() as metadata:editables, like in the RemoteRegistry.remove make cache.editables = {} and at the end of the function restore it.I think at the moment I prefer the later one, until we have more cases.
Most helpful comment
I see, you are right.
I think there are 2 approaches:
with self._cache.package_layout(ref, from-cache=True).update_metadata() as metadata:editables, like in theRemoteRegistry.removemake cache.editables = {} and at the end of the function restore it.I think at the moment I prefer the later one, until we have more cases.