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

[20.09] pythonPackages.pyscreenshot: add missing dependencies #99244

Merged
merged 4 commits into from Oct 1, 2020

Conversation

lsix
Copy link
Member

@lsix lsix commented Oct 1, 2020

Motivation for this change

Backport to release-20.09 the following PRs (apparently, this has not been done):

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 using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@mweinelt
Copy link
Member

mweinelt commented Oct 1, 2020

Adding an imports check

diff --git a/pkgs/development/python-modules/pyscreenshot/default.nix b/pkgs/development/python-modules/pyscreenshot/default.nix
index 7967caf6178..dc92239fbbb 100644
--- a/pkgs/development/python-modules/pyscreenshot/default.nix
+++ b/pkgs/development/python-modules/pyscreenshot/default.nix
@@ -28,6 +28,8 @@ buildPythonPackage rec {
   # recursive dependency on pyvirtualdisplay
   doCheck = false;
 
+  pythonImportsCheck = [ "pyscreenshot" ];
+
   meta = with lib; {
     description = "python screenshot";
     homepage = "https://github.com/ponty/pyscreenshot";

reveals a missing pillow dependency:

Check whether the following modules can be imported: pyscreenshot
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <lambda>
  File "/nix/store/z65l1jqvxa58zzwwa3bvglb6asj4y8cv-python3-3.8.5/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/nix/store/zwbrw49cj30zhkfybn656jli14fznwp8-python3.8-pyscreenshot-2.2/lib/python3.8/site-packages/pyscreenshot/__init__.py", line 4, in <module>
    from pyscreenshot.childproc import childprocess_backend_version
  File "/nix/store/zwbrw49cj30zhkfybn656jli14fznwp8-python3.8-pyscreenshot-2.2/lib/python3.8/site-packages/pyscreenshot/childproc.py", line 5, in <module>
    from pyscreenshot.imcodec import codec
  File "/nix/store/zwbrw49cj30zhkfybn656jli14fznwp8-python3.8-pyscreenshot-2.2/lib/python3.8/site-packages/pyscreenshot/imcodec.py", line 3, in <module>
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'
builder for '/nix/store/n1ryi6j4mjm17ddjrxs62qfic7z2wnmc-python3.8-pyscreenshot-2.2.drv' failed with exit code 1

@lsix
Copy link
Member Author

lsix commented Oct 1, 2020

Yes, you are right. I’ll add a PR ASAP to master and backport it here once accepted. Meanwhile, I mark this pr as draft.

@lsix lsix marked this pull request as draft October 1, 2020 14:40
@mweinelt mweinelt marked this pull request as ready for review October 1, 2020 17:19
@mweinelt
Copy link
Member

mweinelt commented Oct 1, 2020

Result of nixpkgs-review pr 99244 1

8 packages built:
  • python27Packages.entrypoint2
  • python27Packages.pyscreenshot
  • python37Packages.entrypoint2
  • python37Packages.mss
  • python37Packages.pyscreenshot
  • python38Packages.entrypoint2
  • python38Packages.mss
  • python38Packages.pyscreenshot

@jonringer
Copy link
Contributor

Yes, you are right. I’ll add a PR ASAP to master and backport it here once accepted. Meanwhile, I mark this pr as draft.

Upstream should also be notified that they aren't declaring a necessary dependency

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

LGTM

Result of nixpkgs-review pr 99244 1

8 packages built:
  • python27Packages.entrypoint2
  • python27Packages.pyscreenshot
  • python37Packages.entrypoint2
  • python37Packages.mss
  • python37Packages.pyscreenshot
  • python38Packages.entrypoint2
  • python38Packages.mss
  • python38Packages.pyscreenshot

@jonringer jonringer merged commit 11b4cc5 into NixOS:release-20.09 Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants