1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 pytestCheckHook,
7
8 pythonOlder,
9
10 setuptools,
11 wheel,
12 setuptools-scm,
13
14 # for tests
15 base58,
16
17 typing-extensions,
18 typing-validation,
19}:
20
21buildPythonPackage rec {
22 pname = "bases";
23 version = "0.3.0";
24 pyproject = true;
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "hashberg-io";
30 repo = "bases";
31 tag = "v${version}";
32 hash = "sha256-CRXVxT9uYud1CKRcdRAD0OX5sTAttrUO9E4BaavTe6A=";
33 };
34
35 build-system = [
36 setuptools
37 wheel
38 setuptools-scm
39 ];
40
41 dependencies = [
42 typing-extensions
43 typing-validation
44 ];
45
46 nativeCheckInputs = [
47 pytestCheckHook
48 base58
49 ];
50
51 pythonImportsCheck = [
52 "bases"
53 "bases.alphabet"
54 "bases.alphabet.abstract"
55 "bases.alphabet.range_alphabet"
56 "bases.alphabet.string_alphabet"
57 "bases.encoding"
58 "bases.encoding.base"
59 "bases.encoding.block"
60 "bases.encoding.errors"
61 "bases.encoding.fixchar"
62 "bases.encoding.simple"
63 "bases.encoding.zeropad"
64 "bases.random"
65 ];
66
67 meta = {
68 description = "Python library for general Base-N encodings";
69 homepage = "https://github.com/hashberg-io/bases";
70 changelog = "https://github.com/hashberg-io/bases/releases/tag/v${version}";
71 license = lib.licenses.mit;
72 maintainers = [ lib.maintainers.vizid ];
73 };
74}