summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/vat-moss/default.nix
blob: 2d6fe2fc29a86acc09bf215bd11da82c75585e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  setuptools,
  standard-cgi,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "vat-moss";
  version = "0.11.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "raphaelm";
    repo = "vat_moss-python";
    rev = version;
    hash = "sha256-c0lcyeW8IUhWKcfn3BmsbNmHyAzm8T0sdYp0Zp0FbFw=";
  };

  patches = [
    (fetchpatch {
      # Update API URL to HTTPS
      url = "https://github.com/raphaelm/vat_moss-python/commit/ed32b7d893da101332d3bb202d17b1bf89e5d9ed.patch";
      hash = "sha256-GpxaQ6/1LdFdxzXT/p4HS7FHU0WeM0i3LbdRFeqnFdw=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [ standard-cgi ];

  pythonImportsCheck = [ "vat_moss" ];

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTests = [ "test_fetch" ];

  disabledTestPaths = [
    # network access
    "tests/test_id.py"
  ];

  meta = {
    description = "Python library for dealing with VAT MOSS and Norway VAT on digital services. Includes VAT ID validation, rate calculation based on place of supply, exchange rate and currency tools for invoices";
    homepage = "https://github.com/raphaelm/vat_moss-python";
    changelog = "https://github.com/raphaelm/vat_moss-python/blob/${src.rev}/changelog.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ hexa ];
  };
}