diff options
author | Leona Maroni <dev@leona.is> | 2024-05-08 15:08:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 15:08:41 +0200 |
commit | 9a604d82fbc5d8a85a830efc28564cf397a297ab (patch) | |
tree | cdded6d7eec53b802fdb29d5f03882af027932b1 | |
parent | 73a4508d56c1df4a4efc0436b88f352ee2e69a15 (diff) | |
parent | c8ccbc21cbb013b5c138b3293df276b856807c02 (diff) |
Merge pull request #310062 from cyberus-technology/paperless-asn-qr-codes
paperless-asn-qr-codes: init at 0.2.0
-rw-r--r-- | pkgs/by-name/pa/paperless-asn-qr-codes/package.nix | 42 | ||||
-rw-r--r-- | pkgs/development/python-modules/reportlab-qrcode/default.nix | 49 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
3 files changed, 93 insertions, 0 deletions
diff --git a/pkgs/by-name/pa/paperless-asn-qr-codes/package.nix b/pkgs/by-name/pa/paperless-asn-qr-codes/package.nix new file mode 100644 index 0000000000000..1661d7a5a4859 --- /dev/null +++ b/pkgs/by-name/pa/paperless-asn-qr-codes/package.nix @@ -0,0 +1,42 @@ +{ lib +, python3 +, fetchFromGitHub +}: + +python3.pkgs.buildPythonApplication rec { + pname = "paperless-asn-qr-codes"; + version = "0.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "entropia"; + repo = "paperless-asn-qr-codes"; + rev = "v${version}"; + hash = "sha256-/xCU6xDrmhkua4Iw/BCzhOuqO5GT/0rTJ+Y59wuMz6E="; + }; + + prePatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "\"argparse\"," "" + ''; + + nativeBuildInputs = [ + python3.pkgs.hatch-vcs + python3.pkgs.hatchling + ]; + + propagatedBuildInputs = with python3.pkgs; [ + reportlab + reportlab-qrcode + ]; + + pythonImportsCheck = [ "paperless_asn_qr_codes" ]; + + meta = with lib; { + description = "Command line utility for generating ASN labels for paperless with both a human-readable representation, as well as a QR code for machine consumption"; + homepage = "https://github.com/entropia/paperless-asn-qr-codes"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ xanderio ]; + mainProgram = "paperless-asn-qr-codes"; + }; +} diff --git a/pkgs/development/python-modules/reportlab-qrcode/default.nix b/pkgs/development/python-modules/reportlab-qrcode/default.nix new file mode 100644 index 0000000000000..97d1e9d137320 --- /dev/null +++ b/pkgs/development/python-modules/reportlab-qrcode/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchPypi +, setuptools +, wheel +, qrcode +, reportlab +, pillow +, pytest +, pyzbar +}: + +buildPythonPackage rec { + pname = "reportlab-qrcode"; + version = "0.1.6"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-m/oeuA797MEBOJBIG157VIa7TbEbRRVK/O8Arz/oO/o="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + propagatedBuildInputs = [ + qrcode + reportlab + ]; + + passthru.optional-dependencies = { + testing = [ + pillow + pytest + pyzbar + ]; + }; + + pythonImportsCheck = [ "reportlab_qrcode" ]; + + meta = with lib; { + description = "Allows to create QR codes for use with the ReportLab PDF library"; + homepage = "https://pypi.org/project/reportlab-qrcode/"; + license = licenses.mit; + maintainers = with maintainers; [ xanderio ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3bdc702af8374..b2b19b976c0a7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13145,6 +13145,8 @@ self: super: with self; { reportlab = callPackage ../development/python-modules/reportlab { }; + reportlab-qrcode = callPackage ../development/python-modules/reportlab-qrcode { }; + repoze-lru = callPackage ../development/python-modules/repoze-lru { }; repoze-sphinx-autointerface = callPackage ../development/python-modules/repoze-sphinx-autointerface { }; |