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

Don't break on empty patch list for version in conandata.yml (#15841) #15842

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

iskunk
Copy link
Contributor

@iskunk iskunk commented Mar 8, 2024

Changelog: Bugfix: Avoid TypeError when a version in conandata.yml lists no patches.
Docs: Omit

(#15841)

  • 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.

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

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

Hi! Thanks a lot for taking the time to add the extra checks, really appreciated.
Could you add a test to ensure this behaviour is consistent in the future? Else we can contribute the test ourselves no problem :)

conan/tools/files/patches.py Outdated Show resolved Hide resolved
conan/tools/files/patches.py Outdated Show resolved Hide resolved
@AbrilRBS AbrilRBS linked an issue Mar 9, 2024 that may be closed by this pull request
@memsharded memsharded added this to the 2.2.0 milestone Mar 10, 2024
memsharded and others added 2 commits March 11, 2024 08:29
Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
@AbrilRBS AbrilRBS self-assigned this Mar 11, 2024
@AbrilRBS AbrilRBS merged commit 3267b42 into conan-io:develop2 Mar 11, 2024
2 checks passed
@iskunk
Copy link
Contributor Author

iskunk commented Mar 11, 2024

Goodness, this moved before I even got a chance to respond :-]

Could you add a test to ensure this behaviour is consistent in the future?

I'm afraid I'm barely conversant with the testing framework Conan uses; hope it's not a big deal!

Suggested change

I originally wrote the warning like that, but then I saw output like this:

package/1.2.3: Calling source() in /home/src/package-1.2.3
package/1.2.3: apply_conandata_patches(): No patches defined for version 1.2.3 in conandata

I figured, there's no need to print the version twice.

Oh, nevermind, sorry I understood it incorrectly. A warning makes sense.

Yep, I saw that the functions print a warning in a similar instance, and so presumed that the same should happen here.

Thank you both!

@iskunk iskunk deleted the feature/fix-empty-patch-list branch June 26, 2024 00:25
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.

[bug] Breakage when all patches in conandata.yml are commented out
3 participants