Skip to content

python3Packages.diagrams: fix add missing pngs #417585

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

addict3d
Copy link
Contributor

Pull in the resource folder when poetry builds the wheel.

This change uses the patch from mingrammer/diagrams#1128

Fixes #406527

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@@ -34,6 +34,12 @@ buildPythonPackage rec {
url = "https://github.com/mingrammer/diagrams/commit/59b84698b142f5a0998ee9e395df717a1b77e9b2.patch";
hash = "sha256-/zV5X4qgHJs+KO9gHyu6LqQ3hB8Zx+BzOFo7K1vQK78=";
})
# Fix poetry include, https://github.com/mingrammer/diagrams/pull/1128
(fetchpatch {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the following cases, a .patch file should be added to Nixpkgs repository, instead of retrieved:

solves problems unique to packaging in Nixpkgs
cannot be fetched easily
has a high chance to disappear in the future due to unstable or unreliable URLs

None of these apply to this situation.

  1. The problem is not unique to Nixpkgs. The brokenness happens for the Wheel output from recent versions of poetry.
  2. It is easy to fetch from the commit upstream, and another such patch is already in this recipe.
  3. The patch URL is not going to change.

Copy link
Member

Choose a reason for hiding this comment

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

When adding patches in this manner you should be reasonably sure that the used URL is stable. Patches referencing open pull requests will change when the PR is updated and code forges (such as GitHub) usually garbage collect commits that are no longer reachable due to rebases/amends.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you help me understand your concern?

Patches referencing open pull requests will change when the PR is updated

Who do you imagine is going to update mingrammer/diagrams#1128?

Copy link
Member

Choose a reason for hiding this comment

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

Could you help me understand your concern?

Have you noticed that this paragraph is just above the lines you referenced?

Could you help me understand your concern?

Patches referencing open pull requests will change when the PR is updated

Who do you imagine is going to update mingrammer/diagrams#1128?

Could you read the sentence after that?

and code forges (such as GitHub) usually garbage collect commits that are no longer reachable due to rebases/amends.

Copy link
Member

Choose a reason for hiding this comment

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

Could you make sure that

  1. The author will never ask you to modify the change with squashing/force pushing
  2. The author will not push to your branch
  3. The author will not squash-merge your PR
    ?

Even if the author assures you that they won't do that, it's part of the process to avoid such things from happening, and we have no responsibility to do your case study.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, assuming I duplicate my patch to be vendored in this commit, what about the other instance of this immediately above the patch I was adding?

Do I need to open a separate PR to vendor that patch too or can it be left alone to possibly break later?

Copy link
Member

Choose a reason for hiding this comment

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

You can vendor that patch as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I've vendored both of those patches.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for spelling out the reasoning behind the policy.

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 6.topic: python Python is a high-level, general-purpose programming language. labels Jun 17, 2025
@addict3d addict3d changed the title python312Packages.diagrams: fix add missing pngs python3Packages.diagrams: fix add missing pngs Jun 26, 2025
@addict3d addict3d force-pushed the diagrams-fix-missing-pngs branch from faa530e to f9994f4 Compare June 26, 2025 16:24
Pull in resource folder when poetry builds the wheel

Fixes NixOS#406527

Vendor 'Add build-system section' patch per vendoring policy
@addict3d addict3d force-pushed the diagrams-fix-missing-pngs branch from f9994f4 to 7b2323b Compare June 26, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python3Packages.diagrams: missing png images
2 participants