Skip to content
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

#5320 Import Python Patch #5761

Merged
merged 11 commits into from Oct 23, 2019
Merged

Conversation

@uilianries
Copy link
Member

@uilianries uilianries commented Sep 17, 2019

The easiest way to fix our problem related to patching is by the
upstream. However, neither the upstream and their forks are maintaining
the project since 3 years ago.

So idea here is importing the original implementation and merging with the current PR in upstream.

This current PR is able to fix add/rem files using patch apply

Changelog: Fix: Add and remove out-of-tree git patches (#5320)
Docs: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the 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.

uilianries added 2 commits Sep 17, 2019
- The easiest way to fix our problem related to patching is by the
upstream. However, neither the upstream and forks are maintaining
the project since 3 years ago. So idea here is importing the original
implementation and merging with the current PR in upstream.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@lasote lasote added this to the 1.20 milestone Sep 23, 2019
@lasote lasote removed this from the 1.20 milestone Sep 23, 2019
@SSE4
Copy link
Contributor

@SSE4 SSE4 commented Sep 23, 2019

another option: https://github.com/libgit2/pygit2

uilianries added 4 commits Sep 25, 2019
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@memsharded
Copy link
Member

@memsharded memsharded commented Sep 30, 2019

What am I missing here? I cannot find such patch-ng.

@uilianries
Copy link
Member Author

@uilianries uilianries commented Sep 30, 2019

We need to publish first our fork: https://github.com/conan-io/python-patch-ng

@lasote lasote assigned lasote and unassigned jgsogo Oct 1, 2019
@lasote
Copy link
Contributor

@lasote lasote commented Oct 1, 2019

I assign to myself to review the fork and publish to pypi

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@danimtb danimtb added this to the 1.20 milestone Oct 4, 2019
@lasote lasote assigned uilianries and unassigned lasote Oct 10, 2019
@lasote
Copy link
Contributor

@lasote lasote commented Oct 10, 2019

I've published the patch-ng. Looks like it broke some test. Check please

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@lasote
Copy link
Contributor

@lasote lasote commented Oct 15, 2019

We need a test for #5320. I'm not opposed to have it here in Conan.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@lasote lasote assigned lasote and unassigned uilianries Oct 16, 2019
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
client.run("install .")
client.run("build .")
bar_content = load(os.path.join(client.current_folder, "bar.txt"))
self.assertIn(dedent("""Yo no creo en brujas, pero que las hay, las hay
Copy link
Contributor

@lasote lasote Oct 21, 2019

Choose a reason for hiding this comment

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

These asserts here are useless... right? I want to assert the final files in the cache. So do this asserts in the build() method or access to the recipe folder in the cache.

Copy link
Member Author

@uilianries uilianries Oct 21, 2019

Choose a reason for hiding this comment

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

well, they are the result of patch method. I can internalize in build() but I think it will result on same thing. The original file only contains a part of the phrase, after applying the patch the phrase is complete, so the patch need to work.

Copy link
Contributor

@lasote lasote Oct 23, 2019

Choose a reason for hiding this comment

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

ah, ok. I missed that is a local build() method.

lasote
lasote approved these changes Oct 23, 2019
@lasote lasote merged commit 7c55843 into conan-io:develop Oct 23, 2019
2 checks passed
@lasote lasote mentioned this pull request Oct 23, 2019
3 tasks
@uilianries uilianries deleted the hotfix/git-patch-strip branch Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants