jtojnar / nixpkgs-hammering

Beat your package expressions into a shape
MIT License
241 stars 15 forks source link

Marks all buildInputs from python3Packages.pillow as unused #84

Open SuperSandro2000 opened 3 years ago

SuperSandro2000 commented 3 years ago

Evaluation breaks if those packages are removed. Tested on master.

When evaluating attribute ‘python3Packages.pillow’:
warning: attribute-ordering
The lists of dependencies, including the attribute “propagatedBuildInputs” should preferably come before attributes for overriding default phases’ “postPatch” attribute in the expression.

Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/generic.nix:16:3:
   |
16 |   postPatch = ''
   |   ^
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/generic.nix:31:3:
   |
31 |   propagatedBuildInputs = [ olefile ];
   |   ^
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/attribute-ordering.md
warning: attribute-ordering
The lists of dependencies, including the attribute “buildInputs” should preferably come before lists of dependencies’ “checkInputs” attribute in the expression.

Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/generic.nix:33:3:
   |
33 |   checkInputs = [ pytestCheckHook pyroma numpy ];
   |   ^
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/generic.nix:35:3:
   |
35 |   buildInputs = [ freetype libjpeg openjpeg libimagequant zlib libtiff libwebp tcl lcms2 ]
   |   ^
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/attribute-ordering.md
warning: unused-argument
Unused argument: `stdenv`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:1:8:
  |
1 | { lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
  |        ^
warning: unused-argument
Unused argument: `buildPythonPackage`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:1:16:
  |
1 | { lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
  |                ^
warning: unused-argument
Unused argument: `isPyPy`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:1:47:
  |
1 | { lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
  |                                               ^
warning: unused-argument
Unused argument: `olefile`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:3:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |   ^
warning: unused-argument
Unused argument: `freetype`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:12:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |            ^
warning: unused-argument
Unused argument: `libjpeg`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:22:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                      ^
warning: unused-argument
Unused argument: `zlib`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:31:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                               ^
warning: unused-argument
Unused argument: `libtiff`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:37:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                                     ^
warning: unused-argument
Unused argument: `libwebp`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:46:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                                              ^
warning: unused-argument
Unused argument: `tcl`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:55:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                                                       ^
warning: unused-argument
Unused argument: `lcms2`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:60:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                                                            ^
warning: unused-argument
Unused argument: `tk`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:67:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                                                                   ^
warning: unused-argument
Unused argument: `libX11`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:2:71:
  |
2 | , olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
  |                                                                       ^
warning: unused-argument
Unused argument: `libxcb`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:3:3:
  |
3 | , libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
  |   ^
warning: unused-argument
Unused argument: `openjpeg`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:3:11:
  |
3 | , libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
  |           ^
warning: unused-argument
Unused argument: `libimagequant`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:3:21:
  |
3 | , libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
  |                     ^
warning: unused-argument
Unused argument: `pyroma`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:3:36:
  |
3 | , libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
  |                                    ^
warning: unused-argument
Unused argument: `numpy`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:3:44:
  |
3 | , libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
  |                                            ^
warning: unused-argument
Unused argument: `pytestCheckHook`.
Near /home/hotpi/src/nixpkgs2/pkgs/development/python-modules/pillow/default.nix:3:51:
  |
3 | , libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
  |                                                   ^

You have uninstalled pretty_errors but it is still present in your python startup.  Please remove its section from file:
 /home/hotpi/.local/lib/python3.8/site-packages/usercustomize.py
rmcgibbo commented 3 years ago

I see. Here's the expression:

{ lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
, olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
, libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
}@args:

import ./generic.nix (rec {
  pname = "Pillow";
  version = "8.0.1";

  disabled = !isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "11c5c6e9b02c9dac08af04f093eb5a2f84857df70a7d4a6a6ad461aca803fb9e";
  };

  meta = with lib; {
    homepage = "https://python-pillow.org/";
    description = "The friendly PIL fork (Python Imaging Library)";
    longDescription = ''                                                                                                                          
      The Python Imaging Library (PIL) adds image processing                                                                                      
      capabilities to your Python interpreter.  This library                                                                                      
      supports many file formats, and provides powerful image                                                                                     
      processing and graphics capabilities.                                                                                                       
    '';
    license = "http://www.pythonware.com/products/pil/license.htm";
    maintainers = with maintainers; [ goibhniu prikhi SuperSandro2000 ];
  };
} // args )

That //args at the end of the expression is quite devious.

jtojnar commented 3 years ago

Oh, right. callPackage uses builtins.functionArgs to determine what to pass. I guess we will have to consider all functions with @ operator as covered.