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