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
OCRmyPDF: v.5.4.3 #32053
OCRmyPDF: v.5.4.3 #32053
Conversation
|
||
buildInputs = [ pytest pytest_xdist pytestcov setuptools_scm pytest-helpers-namespace pytestrunner glibcLocales ]; | ||
|
||
doCheck = false; |
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.
Skipping tests might be fine but please add a comment why you are skipping them.
meta = with stdenv.lib; { | ||
homepage = https://gitlab.mister-muffin.de/josch/img2pdf; | ||
description = "Losslessly convert raster images to PDF. "; | ||
license = lib.licenses.lgpl3; |
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.
Since you are using with stdenv.lib;
lib is already scoped and this could be shortened to license = licenses.lgpl3;
.
homepage = https://gitlab.mister-muffin.de/josch/img2pdf; | ||
description = "Losslessly convert raster images to PDF. "; | ||
license = lib.licenses.lgpl3; | ||
maintainers = with lib.maintainers; [ hyper_ch ]; |
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.
Same here. Could be with maintainers
.
pkgs/top-level/all-packages.nix
Outdated
@@ -15909,6 +15909,8 @@ with pkgs; | |||
|
|||
notion = callPackage ../applications/window-managers/notion { }; | |||
|
|||
ocrmypdf = callPackage ../applications/graphics/ocrmypdf { }; |
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.
It is better to use pythonPackages.callPackage
, and list python dependencies in the arguments of the function that returns the derivation.
@@ -0,0 +1,23 @@ | |||
{ stdenv, lib, buildPythonPackage, fetchPypi, isPyPy, python3, pytest }: | |||
|
|||
with python3.pkgs; |
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.
Its better to list all dependencies in the function that returns the derivation.
@@ -0,0 +1,23 @@ | |||
{ stdenv, lib, buildPythonPackage, fetchPypi, isPyPy, python3, pytest }: |
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 pass python versions explicitly when called from pythonPackages
.
@@ -0,0 +1,58 @@ | |||
{ stdenv, lib, buildPythonPackage, fetchFromGitHub, fetchPypi, isPyPy, python3, pytest, zlib }: |
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 pass python versions explicitly when called from pythonPackages
.
buildPythonPackage rec { | ||
pname = "pdfrw"; | ||
version = "0.4"; | ||
name = "${pname}-${version}"; |
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.
Since a while back python packages default to name = pname + "-" + version;
so this line is not necessary if pname
and version
are defined.
meta = with stdenv.lib; { | ||
homepage = https://github.com/pmaupin/pdfrw; | ||
description = "Python library and utility that reads and writes PDF files."; | ||
license = lib.licenses.mit; |
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.
Same here, could be simplified.
sha256 = "0qah7rzf9p1l8sj0z19lfyb9dqdwv9a9b4sybv8r2g810bc2i1yp"; | ||
}; | ||
|
||
propagatedBuildInputs = [ ]; |
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.
You could just skip these empty attributes.
Please split this into one commit per new package following the nixpkgs commit message template |
PYTHONPATH="$PYTHONPATH:tests" py.test tests | ||
''; | ||
|
||
buildInputs = [ pytest ]; |
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.
checkInputs
sha256 = "1x1yp63lg3jxpg9igw8lh5rc51q353ifsa1bailb4qb51r54kh0d"; | ||
}; | ||
|
||
static_pdfs = fetchFromGitHub { |
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 should be in a let expression outside buildPythonPackage
|
||
checkPhase = '' | ||
# Copy over the test pdfs and stuff to the building directory | ||
cp -r $static_pdfs/* "./tests/static_pdfs" |
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.
${static_pdfs}
sha256 = "0ihajp4k8vhc4njq7qsh1b22sy09sdwx5ad53x42lr7xfl76m1jy"; | ||
}; | ||
|
||
buildInputs = [ pytest ]; |
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.
checkInputs
@GrahamcOfBorg eval |
@sjau Eval is failing because you did not add yourself to the maintainers list in https://github.com/NixOS/nixpkgs/blob/master/lib/maintainers.nix |
Motivation for this change
Adding a cli-based ocr tool for scanned pfds.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)