1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 hatchling,
8 hatch-vcs,
9
10 # dependencies
11 importlib-resources,
12 iso3166,
13 pycountry,
14
15 # optional-dependencies
16 pydantic,
17
18 # tests
19 pytestCheckHook,
20 pytest-cov,
21 pythonOlder,
22}:
23
24buildPythonPackage rec {
25 pname = "schwifty";
26 version = "2024.4.0";
27 pyproject = true;
28
29 disabled = pythonOlder "3.8";
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-1EV2oi2LBcjw2U7nKqdVUVDlFCzR8RqX5tVIciw1trg=";
34 };
35
36 nativeBuildInputs = [
37 hatchling
38 hatch-vcs
39 ];
40
41 propagatedBuildInputs = [
42 iso3166
43 pycountry
44 ] ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ];
45
46 passthru.optional-dependencies = {
47 pydantic = [ pydantic ];
48 };
49
50 nativeCheckInputs = [
51 pytest-cov
52 pytestCheckHook
53 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
54
55 pythonImportsCheck = [ "schwifty" ];
56
57 meta = with lib; {
58 changelog = "https://github.com/mdomke/schwifty/blob/${version}/CHANGELOG.rst";
59 description = "Validate/generate IBANs and BICs";
60 homepage = "https://github.com/mdomke/schwifty";
61 license = licenses.mit;
62 maintainers = with maintainers; [ milibopp ];
63 };
64}