1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, pytestCheckHook
6}:
7
8buildPythonPackage rec {
9 pname = "vat-moss";
10 version = "0.11.0";
11 format = "setuptools";
12
13 src = fetchFromGitHub {
14 owner = "raphaelm";
15 repo = "vat_moss-python";
16 rev = version;
17 hash = "sha256-c0lcyeW8IUhWKcfn3BmsbNmHyAzm8T0sdYp0Zp0FbFw=";
18 };
19
20 patches = [
21 (fetchpatch {
22 # Update API URL to HTTPS
23 url = "https://github.com/raphaelm/vat_moss-python/commit/ed32b7d893da101332d3bb202d17b1bf89e5d9ed.patch";
24 hash = "sha256-GpxaQ6/1LdFdxzXT/p4HS7FHU0WeM0i3LbdRFeqnFdw=";
25 })
26 ];
27
28 pythonImportsCheck = [
29 "vat_moss"
30 ];
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 ];
35
36 disabledTests = [
37 "test_fetch"
38 ];
39
40 disabledTestPaths = [
41 # network access
42 "tests/test_id.py"
43 ];
44
45 meta = with lib; {
46 description = "A 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";
47 homepage = "https://github.com/raphaelm/vat_moss-python";
48 changelog = "https://github.com/raphaelm/vat_moss-python/blob/${src.rev}/changelog.md";
49 license = licenses.mit;
50 maintainers = with maintainers; [ hexa ];
51 };
52}