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

[21.05] pythonPackages.matplotlib: fix headless detection #124488

Merged
merged 3 commits into from
May 26, 2021

Conversation

rnhmjoj
Copy link
Contributor

@rnhmjoj rnhmjoj commented May 26, 2021

Motivation for this change

Backport of #124439

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change
  • Tested execution of all binary files (none)
  • Added a release notes entry if the change is major or breaking (it's not)
  • Fits CONTRIBUTING.md.

rnhmjoj added 3 commits May 26, 2021 14:19
The default backend is chosen based on the content of the $DISPLAY
variable *and* a successfull call to libX11, loaded via dlopen().
The test fails because dlopen looks in /usr/lib and /lib, so matplotlib
falls back to a headless backend.

To reproduce try running:

    $ nix-shell -I nixpkgs=$PWD -p \
      'python3.withPackages (p: [ p.matplotlib ])' --run python
    >>> import matplotlib.pyplot as plt
    >>> assert plt.get_backend() == "TkAgg"

(cherry picked from commit 7e2ec8f)
@rnhmjoj rnhmjoj requested review from FRidh and jonringer as code owners May 26, 2021 12:32
@ofborg ofborg bot requested review from veprbl and lovek323 May 26, 2021 12:43
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 501+ 10.rebuild-linux: 501-1000 labels May 26, 2021
@rnhmjoj rnhmjoj merged commit 677fab1 into NixOS:release-21.05 May 26, 2021
@rnhmjoj rnhmjoj deleted the mpl-21.05 branch July 10, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant