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 rstr,
15
16 # optional-dependencies
17 pydantic,
18
19 # tests
20 pytestCheckHook,
21 pythonOlder,
22}:
23
24buildPythonPackage rec {
25 pname = "schwifty";
26 version = "2025.1.0";
27 pyproject = true;
28
29 disabled = pythonOlder "3.9";
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-9JLzy+o76x/gvxGokHXm5BOl9QDuGv2ymhJKmomxoso=";
34 };
35
36 build-system = [
37 hatchling
38 hatch-vcs
39 ];
40
41 dependencies = [
42 iso3166
43 pycountry
44 rstr
45 ] ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ];
46
47 optional-dependencies = {
48 pydantic = [ pydantic ];
49 };
50
51 nativeCheckInputs = [
52 pytestCheckHook
53 ] ++ lib.flatten (lib.attrValues 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}