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
Fix copying symlink to directories (2) #7655
Conversation
Thank you for your contribution. I will reach you with some tests regarding the changes here. |
Hi @hifabian and sorry for the delay. I have added a test for the fix you proposed. Thank you! |
ping @hifabian |
…deploy-symlink-dirs
Thank you for writing the tests! |
conans/test/utils/genconanfile.py
Outdated
if self._package_folders: | ||
lines.extend([' tools.mkdir(os.path.join(self.package_folder, "{}"))' | ||
''.format(folder) for folder in self._package_folders]) | ||
if self._package_folders_link: |
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 say that this is an overly test-specific thing, that this should be implemented directly in the test, leaving GenConanfile()
more generic. Only common conanfile patterns should be here.
It is true that the _package_files_link
was already there, but that pattern is used just exactly once in the whole codebase, so probably that deserved to be specified in the test directly, and not generalized here.
Asking @jgsogo for a second opinion.
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.
Yes, I think the same. GenConanfile
must be something generic... even if it cannot be used for some tests. Sometimes it is also better to write the plain conanfile
source if it helps to understand what we are testing.
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.
...but this argument also applies to the with_package_file(..., link)
that is already in the GenConanfile
, only used once.
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.
Yeah, this is what I meant with:
It is true that the _package_files_link was already there, but that pattern is used just exactly once in the whole codebase, so probably that deserved to be specified in the test directly, and not generalized here.
package_files_link
shouldn't be in GenConanfile, but in the specific test that is using it.
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.
done!
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.
Please @danimtb move the test specific code to the test, and leave GenConanfile
generic
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.
👍
Only a couple of details related to the tests.
class DeployGeneratorSymbolicLinkFolderTest(unittest.TestCase): | ||
|
||
def setUp(self): | ||
conanfile = textwrap.dedent(""" |
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.
We typically indent the content inside the textwrap.dedent
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.
done!
Co-authored-by: Javier G. Sogo <jgsogo@gmail.com>
Changelog: Bugfix: Copy symbolic links to directory with deploy generator.
Docs: conan-io/docs#1830
(corrected user compared to #7654 to accept CLA)
fixes #7647
(no updated tests)
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.