nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 66 lines 1.6 kB view raw
1{ 2 lib, 3 fetchFromGitHub, 4 python3Packages, 5 nix-update-script, 6}: 7python3Packages.buildPythonApplication rec { 8 pname = "pyhanko-cli"; 9 version = "0.2.0"; 10 pyproject = true; 11 12 src = fetchFromGitHub { 13 owner = "MatthiasValvekens"; 14 repo = "pyhanko"; 15 tag = "pyhanko-cli/v${version}"; 16 hash = "sha256-ZDHAcI2yoiVifYt05V85lz8mJmoyi10g4XoLQ+LhLHE="; 17 }; 18 19 sourceRoot = "${src.name}/pkgs/pyhanko-cli"; 20 21 postPatch = '' 22 substituteInPlace src/pyhanko/cli/version.py \ 23 --replace-fail "0.0.0.dev1" "${version}" \ 24 --replace-fail "(0, 0, 0, 'dev1')" "tuple(\"${version}\".split(\".\"))" 25 substituteInPlace pyproject.toml \ 26 --replace-fail "0.0.0.dev1" "${version}" 27 ''; 28 29 build-system = [ python3Packages.setuptools ]; 30 31 dependencies = 32 with python3Packages; 33 [ 34 asn1crypto 35 tzlocal 36 pyhanko 37 pyhanko-certvalidator 38 click 39 platformdirs 40 ] 41 ++ lib.concatAttrValues pyhanko.optional-dependencies; 42 43 nativeCheckInputs = with python3Packages; [ 44 pytestCheckHook 45 pyhanko.testData 46 requests-mock 47 freezegun 48 certomancer 49 aiohttp 50 ]; 51 52 passthru.updateScript = nix-update-script { 53 extraArgs = [ 54 "--version-regex=pyhanko-cli/v(.*)" 55 ]; 56 }; 57 58 meta = { 59 description = "Sign and stamp PDF files"; 60 mainProgram = "pyhanko"; 61 homepage = "https://github.com/MatthiasValvekens/pyHanko/tree/master/pkgs/pyhanko-cli"; 62 changelog = "https://github.com/MatthiasValvekens/pyHanko/blob/pyhanko-cli/${src.tag}/docs/changelog.rst#pyhanko-cli"; 63 license = lib.licenses.mit; 64 maintainers = [ lib.maintainers.antonmosich ]; 65 }; 66}