depot/third_party/nixpkgs/pkgs/development/python-modules/jpylyzer/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

55 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, six
, lxml
, pytestCheckHook
}:
let
# unclear relationship between test-files version and jpylyzer version.
# upstream appears to just always test against the latest version, so
# probably worth updating this when package is bumped.
testFiles = fetchFromGitHub {
owner = "openpreserve";
repo = "jpylyzer-test-files";
rev = "146cb0029b5ea9d8ef22dc6683cec8afae1cc63a";
sha256 = "sha256-uKUau7mYXqGs4dSnXGPnPsH9k81ZCK0aPj5F9HWBMZ8=";
};
in buildPythonPackage rec {
pname = "jpylyzer";
version = "2.1.0";
src = fetchFromGitHub {
owner = "openpreserve";
repo = pname;
rev = version;
sha256 = "sha256-LBVOwjWC/HEvGgoi8WxEdl33M4JrfdHEj1Dk7f1NAiA=";
};
propagatedBuildInputs = [ six ];
checkInputs = [ pytestCheckHook lxml ];
# don't depend on testFiles on darwin as it may not be extractable due to
# weird filenames
preCheck = lib.optionalString (!stdenv.isDarwin) ''
sed -i '/^testFilesDir = /ctestFilesDir = "${testFiles}"' tests/unit/test_testfiles.py
'';
disabledTestPaths = lib.optionals stdenv.isDarwin [
"tests/unit/test_testfiles.py"
];
pythonImportsCheck = [ "jpylyzer" ];
disallowedReferences = [ testFiles ];
meta = with lib; {
description = "JP2 (JPEG 2000 Part 1) image validator and properties extractor";
homepage = "https://jpylyzer.openpreservation.org/";
license = licenses.lgpl3;
maintainers = with maintainers; [ ris ];
};
}