1a04744f74
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
80 lines
1.5 KiB
Nix
80 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
cryptography,
|
|
fetchFromGitHub,
|
|
fonttools,
|
|
lxml,
|
|
matplotlib,
|
|
pandas,
|
|
pillow,
|
|
python-barcode,
|
|
qrcode,
|
|
pytestCheckHook,
|
|
requests,
|
|
setuptools,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "borb";
|
|
version = "2.1.25";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jorisschellekens";
|
|
repo = "borb";
|
|
tag = "v${version}";
|
|
hash = "sha256-eVxpcYL3ZgwidkSt6tUav3Bkne4lo1QCshdUFqkA0wI=";
|
|
};
|
|
|
|
# ModuleNotFoundError: No module named '_decimal'
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
grep -Rl 'from _decimal' tests/ | while read -r test_file; do
|
|
substituteInPlace "$test_file" \
|
|
--replace-fail 'from _decimal' 'from decimal'
|
|
done
|
|
'';
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
cryptography
|
|
fonttools
|
|
lxml
|
|
pillow
|
|
python-barcode
|
|
qrcode
|
|
requests
|
|
setuptools
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
matplotlib
|
|
pandas
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [ "borb.pdf" ];
|
|
|
|
disabledTests = [
|
|
"test_code_files_are_small"
|
|
"test_image_has_pdfobject_methods"
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
# Tests require network access
|
|
"tests/pdf/"
|
|
"tests/toolkit/"
|
|
"tests/license/"
|
|
];
|
|
|
|
meta = {
|
|
description = "Library for reading, creating and manipulating PDF files in Python";
|
|
homepage = "https://borbpdf.com/";
|
|
changelog = "https://github.com/jorisschellekens/borb/releases/tag/v${version}";
|
|
license = lib.licenses.agpl3Only;
|
|
maintainers = with lib.maintainers; [ getchoo ];
|
|
};
|
|
}
|