The openai function argument shadowed the `with python3Packages` scope, so withOpenai injected the top-level CLI application into the Python dependencies instead of the library. Also unblocks dropping the top-level openai attribute, whose CLI was removed upstream in v2.35.0.
43 lines
973 B
Nix
43 lines
973 B
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
python3Packages,
|
|
pdfminer,
|
|
|
|
withOpenai ? false,
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication (finalAttrs: {
|
|
pname = "pdftitle";
|
|
version = "0.20";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "metebalci";
|
|
repo = "pdftitle";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-05SaAXYJ7l0ZldYufj0x9mYRwwGT7vlmq9a+ZF4pYiA=";
|
|
};
|
|
|
|
build-system = with python3Packages; [ setuptools ];
|
|
|
|
dependencies =
|
|
with python3Packages;
|
|
[
|
|
pdfminer
|
|
python-dotenv
|
|
]
|
|
++ lib.optional withOpenai openai;
|
|
|
|
pythonImportsCheck = [ "pdftitle" ];
|
|
|
|
meta = {
|
|
description = "Utility to extract the title from a PDF file";
|
|
homepage = "https://github.com/metebalci/pdftitle";
|
|
changelog = "https://github.com/metebalci/pdftitle/blob/v${finalAttrs.version}/CHANGELOG.md";
|
|
license = lib.licenses.gpl3Only;
|
|
maintainers = with lib.maintainers; [ dansbandit ];
|
|
mainProgram = "pdftitle";
|
|
};
|
|
})
|