Skip to content

fixing multiple python requires collission - #3628

Merged
danimtb merged 1 commit into
conan-io:developfrom
memsharded:feature/fix_dup_python_require
Sep 27, 2018
Merged

danimtb merged 1 commit into
conan-io:developfrom
memsharded:feature/fix_dup_python_require

Conversation

@memsharded

@memsharded memsharded commented Sep 27, 2018

Copy link
Copy Markdown
Member

Changelog: BugFix: Fixes python_requires overwritten when using more than one of them in a recipe

@ghost ghost assigned memsharded Sep 27, 2018
@ghost ghost added the stage: review label Sep 27, 2018
@memsharded memsharded added this to the 1.8 milestone Sep 27, 2018
@memsharded memsharded assigned memsharded and danimtb and unassigned memsharded Sep 27, 2018
try:
sys.path.append(os.path.dirname(path))
module = imp.load_source("python_require", path)
module = imp.load_source(str(r), path)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@danimtb
danimtb merged commit d3b9015 into conan-io:develop Sep 27, 2018
@ghost ghost removed the stage: review label Sep 27, 2018
@memsharded
memsharded deleted the feature/fix_dup_python_require branch October 7, 2018 20:24
grisumbras pushed a commit to grisumbras/conan that referenced this pull request Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[python_requires] objects are overwritten when using multiple python_requires calls in one recipe

2 participants