-
Notifications
You must be signed in to change notification settings - Fork 1k
Evaluate always SCM attribute before exporting the recipe #4088
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would need a further explanation about these changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see if it works with python_requires
(or clarify that it doesn't). Also, we have to document this with an example in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about these comments, @memsharded?
|
||
def get_commit(): | ||
here = os.path.dirname(__file__) | ||
here = os.getcwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not exactly the same... as a test (someone can look at it as an example) I prefer the previous behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With __file__
it fails. The file of the python require is located in a different place than the repo
content = load(exported_conanfile) | ||
self.assertIn(commit, content) | ||
# Check that everything works and is usable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I will remove these lines because they are related to python_requires machinery, not to the replacement of the SCM information. I know it is the reason why my previous test was wrong, but now that it is ok these lines are only adding more time to the test suite. If not, can they be conditionally included to the slow
attribute tag?
@lasote, do you think we need to write an example using this? I don't think so, it is expected behavior, just the combination of py_req and the early resolution of SCM |
Updated with a link to the docs |
Evaluate always SCM attribute before exporting the recipe
Changelog: Fix: Evaluate always SCM attribute before exporting the recipe
Docs: conan-io/docs#981
--- Edited by @lasote ---
If the SCM attributes rely on data/status of the working copy we need to evaluate the SCM attributes there. It happens with the
auto
keywords, but it can happen with many other functions:All those data/status won't be available in the
exported
folder of the cache.