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

OCRmyPDF: v.5.4.3 #32053

Closed
wants to merge 5 commits into from
Closed

OCRmyPDF: v.5.4.3 #32053

wants to merge 5 commits into from

Conversation

sjau
Copy link

@sjau sjau commented Nov 25, 2017

Motivation for this change

Adding a cli-based ocr tool for scanned pfds.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@sjau sjau requested a review from FRidh as a code owner November 25, 2017 23:51

buildInputs = [ pytest pytest_xdist pytestcov setuptools_scm pytest-helpers-namespace pytestrunner glibcLocales ];

doCheck = false;
Copy link
Member

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;
Copy link
Member

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 ];
Copy link
Member

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.

@@ -15909,6 +15909,8 @@ with pkgs;

notion = callPackage ../applications/window-managers/notion { };

ocrmypdf = callPackage ../applications/graphics/ocrmypdf { };
Copy link
Member

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;
Copy link
Member

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 }:
Copy link
Member

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 }:
Copy link
Member

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}";
Copy link
Member

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;
Copy link
Member

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 = [ ];
Copy link
Member

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.

@adisbladis
Copy link
Member

Please split this into one commit per new package following the nixpkgs commit message template <package>: init at <version>.

PYTHONPATH="$PYTHONPATH:tests" py.test tests
'';

buildInputs = [ pytest ];
Copy link
Member

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 {
Copy link
Member

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"
Copy link
Member

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 ];
Copy link
Member

Choose a reason for hiding this comment

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

checkInputs

@adisbladis
Copy link
Member

@GrahamcOfBorg eval

@adisbladis
Copy link
Member

@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

@adisbladis adisbladis mentioned this pull request Nov 26, 2017
8 tasks
@sjau sjau closed this Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants