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
pythonPackages.pikepdf: init at 1.2.0 #59908
Conversation
@@ -0,0 +1,40 @@ | |||
{ stdenv, buildPythonPackage, python3Packages, fetchPypi, qpdf, pythonOlder }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't take version specific arguments, use pythonPackages
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use pythonXXPackages
at all :)
buildInputs = with python3Packages; [ defusedxml lxml qpdf pybind11 | ||
setuptools setuptools_scm | ||
]; | ||
checkInputs = with python3Packages; [ nose pytest hypothesis pillow ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually, don't take dependencies from pythonPackages at all, put all these packages in the argument list instead, see how other packages in nixpkgs do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the error you get if you don't have this:
$ nix-shell -p 'python3.withPackages (p: [ p.pikepdf ])' -I nixpkgs=$PWD --pure --run 'python3 -c "import pikepdf"'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/nix/store/697ghwi4qfnl90r1km0566bjcqhjgn3c-python3-3.7.3-env/lib/python3.7/site-packages/pikepdf/__init__.py", line 24, in <module>
from .models import (
File "/nix/store/697ghwi4qfnl90r1km0566bjcqhjgn3c-python3-3.7.3-env/lib/python3.7/site-packages/pikepdf/models/__init__.py", line 11, in <module>
from .metadata import PdfMetadata
File "/nix/store/697ghwi4qfnl90r1km0566bjcqhjgn3c-python3-3.7.3-env/lib/python3.7/site-packages/pikepdf/models/metadata.py", line 16, in <module>
from defusedxml.lxml import parse
ModuleNotFoundError: No module named 'defusedxml'
}; | ||
|
||
buildInputs = with python3Packages; [ defusedxml lxml qpdf pybind11 | ||
setuptools setuptools_scm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be in propagatedBuildInputs
@@ -0,0 +1,40 @@ | |||
{ stdenv, buildPythonPackage, python3Packages, fetchPypi, qpdf, pythonOlder }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use pythonXXPackages
at all :)
Closing due to inactivity. |
Motivation for this change
Dependency for e.g. ocrmypdf
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)