1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 hatch-fancy-pypi-readme,
7 hatch-vcs,
8 hatchling,
9 pydantic,
10 freezegun,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "python-ulid";
16 version = "3.0.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "mdomke";
23 repo = "python-ulid";
24 tag = version;
25 hash = "sha256-ZMz1LqGJDgaMq4BNU33OPOQfoXFFuwFGcplnqtXSOHA=";
26 };
27
28 build-system = [
29 hatch-fancy-pypi-readme
30 hatch-vcs
31 hatchling
32 ];
33
34 optional-dependencies = {
35 pydantic = [ pydantic ];
36 };
37
38 nativeCheckInputs = [
39 freezegun
40 pytestCheckHook
41 ]
42 ++ optional-dependencies.pydantic;
43
44 pythonImportsCheck = [ "ulid" ];
45
46 meta = with lib; {
47 description = "ULID implementation for Python";
48 mainProgram = "ulid";
49 homepage = "https://github.com/mdomke/python-ulid";
50 changelog = "https://github.com/mdomke/python-ulid/blob/${src.tag}/CHANGELOG.rst";
51 license = licenses.mit;
52 maintainers = with maintainers; [ natsukium ];
53 };
54}