fixing multiple python requires collission - #3628
Conversation
| try: | ||
| sys.path.append(os.path.dirname(path)) | ||
| module = imp.load_source("python_require", path) | ||
| module = imp.load_source(str(r), path) |
There was a problem hiding this comment.
Maybe this gives some idea to simplify the plugins code, @danimtb. And maybe even the ConanFileLoader code, we need to review it. The random number to load conanfiles, is because all of them are named "conanfile.py", and a unique name is necessary, it might be possible that the ConanFileLoader could be somehow also affected by this behavior of loading modules with the same name.
There was a problem hiding this comment.
Plugins load function does not used imp.load_source() but __import__(), however it is using some additional code to set unique module names that maybe it is not needed. I will open an engineering issue to look into this
| try: | ||
| sys.path.append(os.path.dirname(path)) | ||
| module = imp.load_source("python_require", path) | ||
| module = imp.load_source(str(r), path) |
There was a problem hiding this comment.
Plugins load function does not used imp.load_source() but __import__(), however it is using some additional code to set unique module names that maybe it is not needed. I will open an engineering issue to look into this
Could close [python_requires] objects are overwritten when using multiple python_requires calls in one recipe #3619
Changelog: BugFix: Fixes
python_requiresoverwritten when using more than one of them in a recipe